The function in my application does the following:
- Capturing a Web Page Using Snoopy
- Upload result to DOMDocument
- Loading a DOMDocument into a simple XML object
- Run XPath to select the section of the required document.
- json_encode result and save to database for later use.
My problem arises when restoring this block from the database and decrypting it. I can see @attributes when I have a var_dump object, but cannot find a combination of commands that allows me to access them.
Error message: Fatal error: you cannot use an object of type stdClass as an array
Below is a sample of my object. I tried, among others, what worked.
echo $obj['class']; stdClass Object ( [@attributes] => stdClass Object ( [class] => race_idx_hdr ) [img] => stdClass Object ( [@attributes] => stdClass Object ( [src] => /Images/Icons/i_blue_bullet.gif [alt] => image [title] => United Kingdom ) ) [a] => Fast Cards )
user137621
source share