Hi,
my problem is:
<?
$string = '<link href="css/test.css" rel="stylesheet"><script language="JavaScript" src="js/test1.js"></script><script language="JavaScript" src="js/test2.js"></script>';
$expression = '/<(.background|link.href|.src)=[\'|"]?(.?)[\'|"]?(W?| .*?)>/i';
preg_match_all( $expression, $string, $matches );
$matches[ 2 ] = array_unique( $matches[ 2 ] );
foreach ( $matches[ 2 ] as $str_value ) {
$string = str_replace( $str_value, '/home/' . $str_value, $string );
}
echo htmlentities( $string );
?>
The epression doesn't replace the second path.
WHY??? and WHAT'S THE SOLUTION?
Thanks.