I am getting the HTML code of this website -
with this code $html = file_get_contents($url)
and then I am running a simple regex which does not work and I have no idea why.
This code output - FALSE
preg_match('/actor/miu', $html);
and this code output - TRUE
str_contains($html, 'actor');
Do you know where it could be the reason I checked the HTML several times. It is the correct HTML.
CodePudding user response:
This page has problems with unicode.
Try preg_match('/actor/mi', $html);