Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php access json object

<?php
  // JSON string
  $someJSON = '[{"name":"Jonathan Suh","gender":"male"},{"name":"William Philbin","gender":"male"},{"name":"Allison McKinnery","gender":"female"}]';

  // Convert JSON string to Object
  $someObject = json_decode($someJSON);
  echo $someObject[0]->name; // Access Object data
?>
Source by jonsuh.com #
 
PREVIOUS NEXT
Tagged: #php #access #json #object
ADD COMMENT
Topic
Name
3+8 =