hello,

i have my file which reads like:
dir3/dir3-3/
dir2/
dir1/
s

now when i run this script:
  $a = file("exclude_dir.txt");
  $t = "dir3/dir3-3/";
  $temp = in_array($t, $a) ? "yes" : "no";
  echo "\$a=";
  var_dump($a);
  echo "<br>";
  echo "in_array(\$t=$t, \$a)=$temp";


 i have this output:
$a=array(4) { [0]=> string(13) "dir3/dir3-3/ " [1]=> string(6) "dir2/ "
[2]=> string(6) "dir1/ " [3]=> string(1) "s" }
in_array($t=dir3/dir3-3/, $a)=no


as you noticed that in each element of the array "$a" a space is appended
for an unknown reason!
that's why my in_array() call returns "no"

any ideas other than doing: $a = split(";", join(';', file("myfile"))); or
something?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to