3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $re = '/\b[Aa]ny\b/'; $str = 'Will *any* company do *any* job, (are there any)?'; If(preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0)){ //string contains word } // Print the entire match result var_dump($matches);
based on GYJXn
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(3) { [0]=> array(1) { [0]=> string(3) "any" } [1]=> array(1) { [0]=> string(3) "any" } [2]=> array(1) { [0]=> string(3) "any" } }