- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?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);