If you're trying to remove it from the database, you could do:
Code:
update tablename set path=replace(path,'../../','../');
That would replace ../../../ with ../../ which may not be what you intend. You could set a condition on the update to match only those records that you want to fix.
If you are trying to remove it from some data, and you knew it was just the first three characters,
Code:
$path = substr('../../file.extension',3);
If you really wanted to remove those 3 characters, and only those 3 if they were present:
Code:
$path = preg_replace('/^..\//','','../../file.extension');
that way, if the string started with /asdf/file.extension, it wouldn't be affected
Another possibility is parse_url, but, I am not sure how it would react.
If you knew that you wanted to pull the first 'section' at the first /, you could do something like
Code:
$arr = (explode('/','../../file.extension'));
array_shift($arr);
$path = join($arr,'/');
That would always get rid of the first element.