P
P
PowerUSB2019-01-17 15:19:02
PHP
PowerUSB, 2019-01-17 15:19:02

How to make PREG_MATCH work correctly with Cyrillic?

Friends, there is a problem with preg_match:

$string = '10-я Соколиной Горы';
preg_match("/[*\d][*\d]-[*\W]/", $string, $math);
print_r($math);

It finds a match, but print_r returns the found substring like this:
Array
(
[0] => 10-�
)
How to treat? The script itself and the string in UTF8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Izmailov, 2019-01-17
@pocifis

/u

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question