fork download
  1. <?php
  2.  
  3. $companies = [
  4. 'acme inc',
  5. 'wORkForce-holdings-ltd'
  6. ];
  7.  
  8. $search = 'WORKFORCE';
  9.  
  10. var_dump(preg_grep('/' . preg_quote($search, '/') . '/i', $companies));
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
array(1) {
  [1]=>
  string(22) "wORkForce-holdings-ltd"
}