更新时间:2023-02-14 12:42:57
尝试一下,您可以查看实时演示
try this, you can check the live demo
<?php
$data['post']= array(
'title' => 'This is title',
'message' =>'This is message',
'datetime' => 'This is date time',
'bannerImage' =>''
);
$data['author']= array(
'authorName' => 'Jason Bourne',
'userType' => 'Registered User',
'address' => 'New York',
'profilePic' => 'Profile picture'
);
$datas[] = $data;
$data['post']= array(
'title' => 'This is title1',
'message' =>'This is message1',
'datetime' => 'This is date time1',
'bannerImage' =>''
);
$data['author']= array(
'authorName' => 'Jason Bourne1',
'userType' => 'Registered User1',
'address' => 'New York1',
'profilePic' => 'Profile picture1'
);
$datas[] = $data;
$json = json_encode(array('data'=>$datas));
echo $json;