How to find the coding for the website, regular expressions?

5c9c57cbdf3dc261074915.png5c9c57eae8d28380489350.png
March 19th 20 at 08:56
1 answer
March 19th 20 at 08:58
Solution
<meta.*charset=["]?([0-9A-z-]+)["]?[\/]?>

<meta charset="utf-8"> // utf-8
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/> // windows-1251
preg_match('<meta.*charset=["]?([0-9A-z-]+)["]?[\/]?>', $string, $result);

? - Berry9 commented on March 19th 20 at 09:01
@Berry9,

preg_match('/<meta.*charset=["]?([0-9A-z-]+)["]?[\/]?>/', $string, $result);
- Brennan_Hickle49 commented on March 19th 20 at 09:04

Find more questions by tags Regular expressionsPHP