Forum Moderators: coopster
Next I need to modif the output in order to obtain ../index.php instead of index.php
(I just need to modif the output not the DB)
how should I do it?
<a href="index.php">Home</a>
and you explode on a space, the
$arr[0] = '<a';
$arr[1] = 'href="index.php">Home</a>';
So the first part is expected, but the second isn't. Are you certain there are no spaces in your input after "Home"?
How about something like
$relative_path = preg_replace('/<a.*href="([^"])/U', '../$1', $url);