I'm still having fun learning xpath and PHP. I'm trying to cut a string that xpath returned using substr() but I'm having no luck with it. I created a seperate string to test if I was using substr() incorrectly. I achieved the result I wanted with the testing string but not the xpath result string.
$temp = $itemPrices->item(0)->nodeValue; // value = "$2.69 per bottle"
//$temp = "$2.69 per bottle"; // testing string
//var_dump($temp); // says both $temp's are strings (tested individually)
$itemPrice = substr($temp,1,4); // hoping for "2.69" (only works with second $temp)
echo $itemPrice; // nothing when using first $temp (xpath result)
Any help with this would be greatly appreciated.