2 ms·I usually write it as $xml = reset(getXpathWhatever()); which returns the first element from array.by z92 15y agoI usually write it as $xml = reset(getXpathWhatever()); which returns the first element from array.