Page 1 of 1

How to filter or trim a vale?

Posted: Wed Jun 23, 2004 4:28 pm
by Cateyes
Hi I was wondering if there is a way to remove 2 periods from a value for example:
$ex="../dir/filename"
so that you could make it look like this:
$ex="/dir/filename"
I am positive there is a simple command and thought I read about in the forums here but can't seem to find it now.

Posted: Wed Jun 23, 2004 4:32 pm
by qads

Code: Select all

<?php
$ex = str_replace("..", "", "../dir/filename");
?>
read up on [php_man]str[/php_man] functions

Posted: Wed Jun 23, 2004 4:51 pm
by Cateyes
Thank you I know it was a simple code but couldn't remeber what it was.