3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\b[Aa]ny\b/'; $str = 'Company any any. Any, '; If(preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0)){ //string contains word } // Print the entire match result var_dump($matches);

preferences:
45.97 ms | 402 KiB | 5 Q