Friday, August 15, 2014

PHP Data to Make JSON

Posted by Unknown  |  No comments

Hi
Today I will showing How to create PHP to JSON Data. It's Easy and simple


PHP Code 

<?php

    $Arraydata= array("UserDetails" => array(array("name" => "Khaled", "age" => "18")), "WorkDetails" => array(array("company_name" => "My Company", "role" => "web application developer", "employees" => "91")));
    $json_encode = json_encode($Arraydata);
    echo $json_encode."<br/>";

 ?>

Output 

{"UserDetails":[{"name":"Khaled","age":"18"}],"WorkDetails":[{"company_name":"My Company","role":"web application developer","employees":"91"}]}

8:27 AM Share:
About Naveed Iqbal

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim venenatis fermentum mollis. Duis vulputate elit in elit. Follow him on Google+.

0 comments:

Visitors Counter

Flag Counter

Recent Post

Popular Posts

Proudly Powered by Blogger.
back to top