Suddenly, it was necessary to cut out Chinese characters from text files and save them to another file. It seems nothing complicated, but I still do not understand how to set the range of simplified hieroglyphs in a regular expression.
Suddenly, it was necessary to cut out Chinese characters from text files and save them to another file. It seems nothing complicated, but I still do not understand how to set the range of simplified hieroglyphs in a regular expression.
Source: https://ru.stackoverflow.com/questions/538491/
All Articles
preg_replace_callback('~\p{Han}+~', function($m) use($filename) { savetofile($m[0], $filename); return ''; }, $str);- Wiktor Stribiżew