Fellows I have the following string:
<meta charset="UTF-8">
That can be either
Over an html string and I want to extract the UTF-8. I tried with the follwoing code:
preg_match_all('/^(<\s*meta\s*) charset=[^"]\s*($>)*/ix', $contents, $matches);
But somehow Does not work and I do not know why.