Search This Blog

Friday, 16 March 2018

To creating web-services in PHP

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"}

No comments:

Post a Comment

First HTML blog

Hello there


echo 'dddd';
?>

Js to show Hide Content

Js: var showChar = 250;  // How many characters are shown by default     var ellipsestext = "...";     var moretext = "Sh...