You are here: Re: Explode + url faking problem « PHP Programming Language « IT news, forums, messages
Re: Explode + url faking problem

Posted by frizzle on 05/29/06 01:12

Toby Inkster wrote:
> frizzle wrote:
>
> > Only now if there are two slashes behind each other
> > (folder//subfolder)
>
> Best thing is to make sure explode() never even sees that.
>
> <?php
> $url = 'folder//subfolder/////somefile';
>
> while (strstr($url, '//'))
> $url = str_replace('//', '/', $url);
>
> $parts = explode('/', $url);
>
> print $parts[0]; /* prints 'folder' */
> print $parts[1]; /* prints 'subfolder' */
> print $parts[2]; /* prints 'somefile' */
> ?>
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact

Well, i figured right now, explode ignores it, and goes past it.
The way you present it, is axactly what it does right now w/o any
str_repl().
What i'd like is to have $array[1] to be empry or null, etc.

I hope you get it.

Frizzle.

 

Navigation:

[Reply to this 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

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