[ot]Pleeeeaaaaasssseeeee don't use
array_shift() there, it is intended to manipulate an array variable and when not used on one (as above) you'll get an
E_STRICT message (
Strict Standards: Only variables should be passed by reference in X on line X) each and every time it is used.
There is nothing wrong with accessing the element(s) in the array with normal array offset syntax (
$page), a loop (
foreach ($page as $p)…) or if you really must, some other function which gets the item from the array without expecting an array variable.
It might also be nice to try and get at the title directly, which isn't so "simple" with SimpleXML but is with DOM.
$doc = new DOMDocument;
$xpath = new DOMXPath($doc);