如何在php中拆分从右到左的字符串

In my php code I need to split an arabic string. However when I copy the string it writes in left to right direction and split function splits the string reversly. Is there a way in php to say that make the string in rtl direction so that it splits correctly?

$text="انا احمد.";

$mysplit = mb_split(' ',$text);

Though your question is bit vague. Seems that array_reverse is what you are looking for.

$text="انا احمد.";
$mysplit = mb_split(' ',$text);
$mysplit = array_reverse($mysplit);

CodeViper Demo.

Actually adding \u200e in front of the string, marks it as left to right. So then you might be able to split it without needing to reverse the array.

For Right to Left marking the character is \u200f