Using JSONPath in your PHP application requires you to include the JSONPath PHP implementation available at https://code.google.com/p/jsonpath/, and parsing the JSON string to a PHP mixed object before applying the JSONPath path you want to extract data from with the
You'll need to download
jsonpath.php from code.google.com at https://code.google.com/p/jsonpath/ and include it in your application with the
require_once instruction. You'll also need to ensure that your PHP implementation includes
Here's a simple example:
<html> <body> <pre> <?php require_once('jsonpath.php'); $json = '…'; // from the introduction to this chapter $object = json_decode($json); ...