Bonsoir, je développe un script qui dois de donner les metadata des pages en arabe, sauf qu'à l'affichage, ça me donne ça


Ù�Ù�Ù�Ø⊃١; Ù�Ù�تÙ�ب Ù�Ù�Ø«Ù� Ø£Ù�بر Ù�جتÙ�Ø⊃١; Ø⊃١;ربÙ� Ø⊃١;Ù�Ù� اÙ�Ø¥Ù�ترÙ�ت Ù�Ù�Ù�دÙ� برÙ�د اÙ�Ù�ترÙ�Ù�Ù� Ø⊃١;ربÙ� Ù�Ù�جتÙ�Ø⊃١; اØ⊃٣;Ù�اÙ�Ù� Ù�دردشة Ù�اÙ�Ø⊃١;اب Ù�Ù�Ù�باÙ�Ù� Ù�Ù�دÙ�Ù�ات Ù�Ø⊃٢;Ù�اج Ù�اÙ�Ù�اÙ� Ù�اخبار Ù�بطاÙ�ات Ù�رÙ�اضة Ù�Ù�Ù�ت Ù�Ø⊃٣;Ù�ر Ù�ابراج Ù�Ù�Ù�تدÙ� Ù� صÙ�ر باÙ�إضاÙ�Ø© Ø¥Ù�Ù� اÙ�Ù�Ø⊃٢;Ù�د.

le script:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
function get_meta_data($url, $searchkey='') {   
print "<h1>$url</h1>";
    $data = get_meta_tags($url);    // get the meta data in an array
    foreach($data as $key => $value) {
 
        $value = strtr($value, get_html_translation_table(HTML_ENTITIES));    // mask the content
        if($searchkey != '') {    // if only one meta tag is in demand e.g. 'description'
            if($key == $searchkey) {
                $str = $value;    // just return the value
            }
        } else {    // all meta tags
            $pattern = '/ |,/i';    // ' ' or ','
            $array = preg_split($pattern, $value, -1, PREG_SPLIT_NO_EMPTY);    // split it in an array, so we have the count of words           
            $str .= '<p><span style="display:block;color:#000000;font-weight:bold;">' . $key . ' <span style="font-weight:normal;">(' . count($array) . ' words | ' . strlen($value) . ' chars)</span></span>' . $value . '</p>';    // format data with count of words and chars
        }
    }