How to How to check PHP multiple Conditional Statements in one. Somethig like this :
if($image_ex == "{gif|jpg|png|jpeg}"){
//something
}
How to How to check PHP multiple Conditional Statements in one. Somethig like this :
if($image_ex == "{gif|jpg|png|jpeg}"){
//something
}
You need to use a regex, use multiple conditions, or put the values in an array. I'd use http://php.net/manual/en/function.in-array.php.
if (in_array($image_ex , array('gif', 'jpg', 'png', 'jpeg'))) {
A regex approach could be:
if(preg_match('/^(?:gif|png|jpe?g)$/', $image_ex)){
or the long multiple conditions approach:
if($image_ex == "gif" || $image_ex == "jpg" || etc..){