<?php
header("Content-Type: text/plain; charset=UTF-8");
$results = (object) array(
"status" => true,
"category" => (object) array(
"ID" => 1,
"title" => "title",
"description" => "description"
),
"posts" => array()
);
for($i = 1; $i <= 10; ++$i)
$results->posts[] = (object) array(
"ID" => $i,
"type" => "post_" . $i,
"title" => "title_" . $i,
"content" => "content_" . $i,
"excerpt" => "excerpt_" . $i,
"published_at" => (time() - ($i * 60 * 60)),
"comments" => array()
);
print_r(
json_encode(
$results
)
); Json formatında PHP ile veri tabanı sorgusu yapmak - YARDIM !
9
●3.850
- 12-11-2013, 22:13:05Hocam çok sağ olun aslında cevabı vermişsiniz benim istediğim formatı şu şekilde sağlayabildim.