This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Is RTL | |
* Check if there RTL characters (Arabic, Persian, Hebrew) | |
* this function works in fuzzy mode | |
* | |
* @author Khaled Attia <[email protected]> Mahdi Ghayour <[email protected]> | |
* @param String $string | |
* @return float betwwen 0~1, (0 for ltr and 1 for rtl) | |
* @example if( is_rtl($string) > 0.5 ) { // do sth } |