Reply to Re: Adding BS to paths

Your name:

Reply:


Posted by Erwin Moller on 06/12/06 08:48

ImOk wrote:

> I need to add a filename to a path under Windows. Sometimes the path
> may have the "\" sometimes not. Is there some function that checks if
> the path does not end in "\" to add it or some quick way of doing this?

Hi,

This is very basic.
Just check if the last character is a \.
if not: add it.

Or alternatively, you can use rtrim indeed as you did.

>
> E.g. addBs($path) . $filename;
>
> The most efficient way I could think of is

What do you mean by efficient?
Is your webserver crashing under the load of this
end-of-string-manipulation?
;-)

Is something isn't broken, don't fix it.
Your solution is just fine.

Regards,
Erwin Moller

>
> rtim($path,"\\") . "\\" . $filename;
>
> Thanks.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация