I do have the following pregmatch:
$search = 310850;
if (preg_match("/\b$search\b/i", $response)) {
echo "match !";
} else {
echo "NO MATCH";
}
response contains alot of things, but it contains 310850
and also 3108502
and 31085
.
to info: $response
contains a html page with alot of elements that contains the $search
How can i make sure i get a match on 310850
and not all the others?
EDIT:
How do i allow the characters <
and >
to be next to the search?
they could be wrapped on ded123>number<blabla