Re: Re: Weird problem with is_file()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2010-04-26 at 17:56 +0200, Michelle Konzack wrote:

> Hello Peter,
> 
> Am 2010-04-26 09:28:28, hacktest Du folgendes herunter:
> > var_dump($isfile);
> > 
> > Don't make assumptions of what the value is, just check it.
> 
> Yes and grmpf!
> 
> The filename has a space at the end but it can not removed even using
> 
>     var_dump(str_replace(' ', '', $isfile);
> 
> if I put a '1' as search parameter all '1' are removed, but  WHY  can  I
> not remove a space at the end?
> 
> Even if a do a
> 
>   mv the_file_not_recognized the_file_not_recognized\<space>
> 
> it is not detected... even if the var_dump() show me something like
> 
>   string(29) "/tmp/the_file_not_recognized "
> 
> Simple to test
> 
>     exec("touch /tmp/the_file_not_recognized");
>     $FILE=shell_exec("ls /tmp/the_file_not_* |head -n1");
>     var_dump($FILE);
>     echo "<br>";
>     var_dump(str_replace(' ', '', $FILE);
> 
> Thanks, Greetings and nice Day/Evening
>     Michelle Konzack
>     Systemadministrator
> 


It's probably not a space but some other non-displayed character. Check
the ascii value of that actual character. A space is 32, anything else
can be replaced using str_replace(chr(x), '', $FILE) if you can't type
it with your keyboard.

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux