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?
defaultdirective.if (!in_array($sale["status"], array(4,6,2,10,1,12,0,1,1,2)) { $sale["status"] = 0 } else { str_replace stuff}? ... or you could just ternary the assignment... or you could do this in DB with acaseandin.preg_replace():-eval.in/741019