<?php $str = 'תירס גדול A-10 (פרי גליל)'; echo preg_replace_callback( "/\p{Hebrew}+(?: \p{Hebrew}+)*/u", fn($m) => implode( array_reverse( preg_split('~~u', $m[0], 0, PREG_SPLIT_NO_EMPTY) ) ), $str );
You have javascript disabled. You will not be able to edit any code.