Page 1 of 1

Changing Objects

Posted: Tue Aug 05, 2003 1:40 am
by Mr. Tech
Hi!

I'm trying to change this:

$path = "|O|Dir1|O|Dir2|O|Dir3

To:

../../../

Using PHP. I tried using this but it doesn't seem to work:

$howfar = eregi_replace("\|O|([a-z0-9\|]+)", "../", $path);

Any help?

Posted: Tue Aug 05, 2003 7:11 am
by pootergeist
$dirs = explode("|0|",$path);
$new_path = '';
foreach($dirs AS $dir)
{
$new_path = $dir .'/';
}

that sort of thing?