- var_dump: documentation ( source)
- preg_replace_callback: documentation ( source)
- strrev: documentation ( source)
<?php
$word = "רחוב אלסלבדור 41 דירה 84 ירושלים";
$word= preg_replace_callback('#([א-ת]+)#', function($matches) {
return strrev($matches[1]);
}, $word);
var_dump($word);