Re: Re: [PHP] Spaces in filename or path
| From: | Ashley Sheridan | Date: | Sat, 30 Apr 2011 22:11:41 +0000 |
| Subject: | Re: Re: [PHP] Spaces in filename or path | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312604@lists.php.net to get a copy of this message | ||
"Tim Streater" <tim@clothears.org.uk> wrote:
>On 30 Apr 2011 at 22:33, Richard Quadling <rquadling@gmail.com> wrote:
>
>> On 30 April 2011 22:07, Tim Streater <tim@clothears.org.uk> wrote:
>>> Does it matter to PHP filesystem functions if a path/to/file/name
>contains
>>> spaces? IOW, is this handled OK by design or should I replaces such
>spaces by
>>> backslash-space or would doing that present problems?
>>>
>>> Thanks -- tim
>>
>> On Windows, PHP will happily access files and directories with
>spaces...
>
>Richard,
>
>I'll be doing this under OS X. I will be passing such paths/names to
>shell scripts too, but AIUI I can use escapeshellarg () there. As long
>as PHP filesystem functions don't have a problem then I should be OK.
>
>Cheers -- tim
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
MacOS treats spaces the same as Linux. Like Richard said, you can use quotes if you're passing
things to the shell, and also a backslash will work too. The only thing I would avoid if possible is
spaces in paths that would reach the client side, i.e. in image paths, css files, etc, as I've
heard historic browsers have trouble sometimes escaping the spaces automatically.
Thanks
Ash
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.