[PHP] readdir problem with white spaces

2006-06-15 Thread Francisco Morales
Hello, I the following problem with readdir 

 

When I read the directory, if the file has more than one white spaces,
readdir only return me 

the file with one space ...

 

so if I have on the file system . ROAD 1  005.JPG  or ROAD1
0005.JPG  php readdir 

return me ROAD 1 005.JPG!!

 

while ($file = readdir ($dirlist))

   {

   if ($file != '.'  $file != '..')

   {   echo FILE: $filebrbr;  - ROAD 1 005.JPG

}

 

-rw-rw-r--  1 seaquist edi  125352 jun 15 12:06 ROAD 1 001.JPG

-rw-rw-r--  1 seaquist edi  157365 jun 15 12:06 ROAD 1 002.JPG

-rw-rw-r--  1 seaquist edi  115891 jun 15 12:07 ROAD 1 004.JPG

-rw-rw-r--  1 seaquist edi  135876 jun 15 12:07 ROAD 1 005.JPG

-rw-rw-r--  1 seaquist edi  103983 jun 15 12:07 ROAD 2  003.JPG

-rw-rw-r--  1 seaquist edi   92410 jun 15 12:07 ROAD 2  006.JPG

-rw-rw-r--  1 seaquist edi   75342 jun 15 12:07 ROAD 3  002.JPG

 

How can I fix this?

 

Thanks a lot

 


Key fingerprint = A232 A22F AEF0 1988 6ACB  99AF A18F A220 BD2E 8CD8

 



RE: [PHP] readdir problem with white spaces

2006-06-15 Thread Jay Blanchard
[snip]

When I read the directory, if the file has more than one white spaces,
readdir only return me 

the file with one space ...

 

so if I have on the file system . ROAD 1  005.JPG  or ROAD1
0005.JPG  php readdir 

return me ROAD 1 005.JPG!!
[/snip]


Additional white space is typically ignored in programming languages
that are built to deal with strings, but you may be able to count the
string length and/or use regex to make sure that the white space
remains.
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php