There is the text number 2 (644) August 19, Friday, 2018
$mytext = "№2 (644) 19 январь, пятница, 2018 год"; $mytext = str_replace(',', ",\r\n", $mytext); $mytext = str_replace(')', ")\r\n", $mytext); echo nl2br($mytext); Now it turns out
№2 (644) 19 августа, пятница, 2018 год A question such as making a line break not all commas but only the second one, well, or the last one, or from the end of the first =)
what would happen like this
№2 (644) 19 августа, пятница, 2018 год