|
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.
[Back to original message]
|