I need to change some words to numbers. Example is below-
$status= str_replace(array("canceled","shipped","processing","complete","pending_payment","closed","fraud","holded","payment_review","pending"),array(4,6,2,10,1,12,0,1,1,2),$sale["status"]);
But if unexpected words come from DB ı want to change it to 0.
Is this possible?