Posted By

allnatural on 01/22/10


Tagged

php json


Versions (?)

PHP to JSON


 / Published in: PHP
 

URL: http://www.destroyyourcomputer.com

  1. //flash.php
  2. class Person {
  3. var $surname;
  4. var $lastname;
  5. }
  6.  
  7. $person[0] = new Person();
  8. $person[0]->lastname = "Bryant";
  9. $person[0]->firstname = "Kobe";
  10.  
  11. $person[1] = new Person();
  12. $person[1]->lastname = "Owen";
  13. $person[1]->firstname = "Michael";
  14.  
  15. echo json_encode($person);

Report this snippet  

You need to login to post a comment.