The code below is in PHP and returns prices from a XML response file.
$price = $result->Items->Item->OfferSummary->LowestNewPrice->FormattedPrice; //lowest new price
$listPrice = $result->Items->Item->Offers->Offer->OfferListing->Price->FormattedPrice; //list price
If I echo $price or $listPrice it works
I wish to get the difference between the two prices but I am getting NULL if I do
$savings = $listPrice - $price; or $savings = ($listPrice - $price);
Any assistance is welcome
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…