June 2015
Intermediate to advanced
192 pages
4h 8m
English
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 jsonPath function.
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 json_decode.
Here's a simple example:
<html> <body> <pre> <?php require_once('jsonpath.php'); $json = '…'; // from the introduction to this chapter $object = json_decode($json); ...Read now
Unlock full access