PHP code example of alrik11es / object-dot-notation
1. Go to this page and download the library: Download alrik11es/object-dot-notation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alrik11es / object-dot-notation example snippets
$result = r(); // imagine this is the result from an API with the json message abobe
if(is_object($result) && property_exists($result, 'hits')){
if(is_object($result->hits) && property_exists($result->hits, 'products')){
$whatiwant = $result->hits->products;
}
}