الصفحة الرئيسية
المزايا
المشروع
روابط مفيدة
تنزيل
الأسئلة الشائعة
النسخة القديمة
Related Class Documentation

<?php
    $text 
= <<< END
    <p><b> Peace سلام  
    שלום Hasîtî 
    शान्ति Barış  和平 Мир
    </b></p>
END;
    
    require(
'I18N/Arabic.php');
    
$Ar = new I18N_Arabic('Identifier');
    
    
$pos $Ar->identify($text);
    
    
$total count($pos);
    
    echo 
substr($text0$pos[0]);
    
    for(
$i=0$i<$total$i+=2){
        echo 
'<font color="#FFFF00">';
        echo 
substr($text$pos[$i], 
                    
$pos[$i+1]-$pos[$i]);
        echo 
'</font>';
        echo 
substr($text$pos[$i+1], 
                    
$pos[$i+2]-$pos[$i+1]);
    }
    
    
$word 'Khaled';
    echo 
"<br /><br />($word) is Arabic? ";
    
var_dump($Ar->isArabic($word));
    
    
$word 'خالد';
    echo 
"<br /><br />($word) is Arabic? ";
    
var_dump($Ar->isArabic($word));
?>




(Khaled) is Arabic? string(0) ""

(خالد) is Arabic? string(1) "1"
As soon as you mention something ... if it's good, it goes away ... if it's bad, it happens.
حالما تذكر أمرا ما، إن كان جيدا فسيختفي، وإن كان سيئا فسيحدث
Index | Features | ArPHP Project | Useful Links | Download | PHP4!!!

Copyright © 2006 - 2021 Khaled Al-Sham'aa. All Rights Reserved | Sourceforge.net | GitHub.com | Terms Of Use

 

  If not now when? If not you and me who else? | إن لم يكن الآن فمتى؟ إن لم تكن أنت وأنا فمن غيرنا؟