From what I understand, get_object_vars() will pull the properties of the object.
Therefore, display $paragraph first and see what is really in it.
Use print_r($paragraph);
This will show the array which is really the paragraph object. So, the issue is that your $paragraphlist
contains an array of objects. And the function get_object_vars() is defined as:
" Gets the accessible non-static properties of the given object according to scope. " (as an array)
And, what it returns is defined as:
" Returns an associative array of defined object accessible non-static properties for the specified object in scope. If a property has not been assigned a value, it will be returned with a NULL value. "
So, you can’t just print the results as it is an “associative” array. You need to tell it which part you want.
Normally as far as I know, you display the nodeValue like this:
echo $domElement->nodeValue;
This is if the $domElement is set up as a real DOMElement as you spelled it.
If $paragraph was defined as a DOM Element, then just " echo $paragraph->nodeValue; " will work…
I searched for this and found the manual at: http://php.net/manual/en/class.domelement.php
Skip down to the contributed stuff as the rest you already know…
Not sure if that helps. Hope so! Good luck, let us know…