3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* $term= '1234'; $term= 'diego 1234'; $term= 'diego rodriguez'; */ $term= 'diego rodriguez 1234'; $terms=explode(' ',$term); var_dump(count($terms)); $where=" AND ("; $i=0; foreach ($terms as $value) { var_dump(is_numeric($value)); } /* foreach ($terms as $value) { if($i!=0) $where.=" AND "; $where.=" (firstname LIKE '%".$value."%' OR lastname LIKE '%".$value."%')"; $where.=" ) OR ci LIKE '%".$value."%'"; $where.=" OR nroanterior LIKE '%".$value."%'"; $i++; } var_dump($where); */
based on 78IFE
Output for 5.3.22 - 7.2.6
int(3) bool(false) bool(false) bool(true)