Create a PHP file like services.php Inside it just write few codes as follow:
<?php
$arr = array('name'=>'Test Name', 'company'=>'Test Company', 'designation'=>'Test Dev', 'profile'=>'PHP');
json_encode($arr);
print json_encode($arr);
?>
See the result in browser, you will find result as follow:
{"name":"Arti","company":"Sparx","designation":"Drupal Dev","profile":"PHP"}
<?php
$arr = array('name'=>'Test Name', 'company'=>'Test Company', 'designation'=>'Test Dev', 'profile'=>'PHP');
json_encode($arr);
print json_encode($arr);
?>
See the result in browser, you will find result as follow:
{"name":"Arti","company":"Sparx","designation":"Drupal Dev","profile":"PHP"}
No comments:
Post a Comment