- print_r: documentation ( source)
- preg_match_all: documentation ( source)
- in_array: documentation ( source)
<?php
$str = 'Just 44 4 test 444';
preg_match_all('!\d+!', $str, $matches);
print_r($matches);
if (in_array("4", $matches[0])){
echo "Match found";
}
else
{
echo "Match not found";
}