Hi,
I am trying to replace an image inside an html file using this:
The file contains this:
<img class="uiProfilePhoto headerTinymanPhoto uiProfilePhotoLarge img" src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/370282_100003830116243_1299179951_q.jpg" alt="" />
And I want to replace it with this:
<img class="uiProfilePhoto headerTinymanPhoto uiProfilePhotoLarge img" src="http://example.com/FC.jpg" alt="" />
This is what I have tried:
$URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'";
$page_html = preg_replace("#headerTinymanPhoto uiProfilePhotoLarge img\" src=\"($URLSearchString)\"#", 'http://example.com/FC.jpg', $page_html);
But its not working.
Can anyone see what I have done wrong ?
Is preg_replace the correct tool to use ?
Thanks.
.