|
Posted by Toby Inkster on 05/29/06 00:36
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
Navigation:
[Reply to this message]
|