How can I remove all Russian letters from a string in PHP?
Or vice versa, I would save only.
English letters, spaces, numbers and all characters, such as! @ # $% ^ & * () {} ":?> <> ~ '"
How can I do this, thanks.
I understand, I replace all Russian crickets ### and then I substring from beginning to end.
$desc = preg_replace('/[-]+/iu','###', $desc); $start = strpos ($desc,'###'); $end =strrpos ($desc,"###"); if($start!==false) { $descStart = substr($desc,0,$start); $descEnd = substr($desc,$end+3); $desc = $descStart.$descEnd; }
source share