Posted by Toby A Inkster on 04/27/07 10:33
FFMG wrote:
> htt://www.example.tdl/folder1/folder2/page.html
>
> I want to get the folders from the root, so the folder would be
> $f = './folder1/folder2/'
> and the page
> $p = 'page.html'
Something like this?
<?php
$components = explode('/', $_SERVER['REQUEST_URI']);
$p = array_pop($components);
$components[] = '';
$f = implode('/', $components);
?>
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|