Strange with function to list countries from txt
<p>i have a problem and i can't explain it ,,
first this is my function </p>

<pre><code>function list_countries($id,$name=null,$result=null){
    $countries = 'countries.txt';
    $selected = '';
    echo  '&lt;select name="'.$name.'" id="'.$id.'"&gt;';
    echo '&lt;option disabled&gt;طالب الغد&lt;/option&gt;';
    if(file_exists($countries)){
        if(is_readable($countries)){
            $files = file_get_contents($countries);
            $files = explode('|',$files);
            foreach($files AS $file){
                $value = sql_safe($file);
                if(strlen($value) &lt; 6){
                    echo '&lt;option disabled&gt;'.$value.'&lt;/option&gt;';
                }else{
                    if($value == $result){
                        $selected = ' selected="selected" ';
                    }
                    echo '&lt;option value="'.$value.'".$selected.'&gt;'.$value.'&lt;/option&gt;';
                }
            }
        }else{
            echo 'The file is nor readable !';
        }
    }else{
        echo "The file is not exist !";
    }
    echo '&lt;/select&gt;';
}
</code></pre>

<p>Now the explain 
i have a text file includes a countries names separated with "|"
In this file there is a heading before the countries ,, i mean Like this </p>

<pre><code>U|United Kingdom|United State|UAE etc ..
L|Liberia|Libya  etc ..
</code></pre>

<p>Now what the function Do is Disabled the Heading , and it's always one character ..
but the strlen function the minimum number that it's give to me is 5 not one .. " This is the first problem
The second one in the $result never equaled the $value and ether i don't know why ??</p>
