Answer the question
In order to leave comments, you need to log in
How to cut string for fio?
Good afternoon, please tell me the regular expression so that the line of the form
Surname First Name Patronymic becomes the type Surname I.O.
Answer the question
In order to leave comments, you need to log in
No way. Surnames/first names can contain spaces, hyphens and apostrophes - it is impossible to determine unequivocally where the surname ended and the name began
https://habrahabr.ru/post/259121/
echo preg_replace('/(\s[А-ЯЁ])[а-яё]+/u','$1.','Фамилия Имя Отчество');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question