3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows22['Status2']="PR001:Approved,SA001:Rejected"; $che = "SA001"; if($rows22['Status2'] == "") { $status = ""; } else { $ks = 0; $ched = explode(',',$che); while($ks < sizeof($ched)) { if (strpos($rows22['Status2'],$ched[$ks]) !== false) { $sts = explode(',',$rows22['Status2']); $s = 0; while($s < sizeof($sts)) { if (strpos($sts[$s],$ched[$ks]) !== false) { $sts[$s] = ""; } if($s == 0) $status = $sts[$s]; else { $status = $status.",".$sts[$s]; } $s++; } } else { $status = $rows225['Status2']; } $ks++; } }

preferences:
58.51 ms | 405 KiB | 6 Q