preg_replace help
| From: | Ben | Date: | Fri, 19 Dec 2003 17:11:44 +0000 |
| Subject: | preg_replace help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173031@lists.php.net to get a copy of this message | ||
I am trying to build a pattern to do the following:
- Find all occurences of HREF=" and SRC=" except those that include the
HTTP:// in their path
- Insert my own domain string (e.g.: http://www.my_domain.com)
So has an example the input string would be :
$val = '<A hrEf="http://www.test.com/test.php">ssdf</A><BR><A
HrEf="hello.com">2</A><IMG src="test.jpg"><IMG
src="http://www.test.com/images/dfgdf.jpg">';
And I would like to end up with: