0){ //Check if the variable matches any given type foreach($types as $type){ if(!is_string($type)){ //Type from 'String' or Type from 'Type' $type = gettype($type); } if(strtolower(gettype($variable)) === strtolower($type)){ return $variable; } } }else{ if(is_array($variable)){ return $variable; } } }else{ //Type from 'String' or Type from 'Type' //Check if the variable matches the given type if(!is_string($types)){ $types = gettype($types); } if(strtolower(gettype($variable)) === strtolower($types)){ return $variable; } } } return $fail; }