Hello
I found this function:
function GetImageSource($strHtml)
{
$strRegExp = '/<img (?:.*?)src=(?:"|\'){1}(.*?)(?:"|\'){1}/is';
$arrMatches = array();
$bolMatched = preg_match_all($strRegExp,$strHtml,$arrMatches);
if( $bolMatched!==false && isset($arrMatches[1]) )
{
return $arrMatches[1];
}
else
{
return false;
}
}
How can I replace all <img src="xxxx.jpg" to <a href="xxxx.jpg><img src="xxxx.jpg" ? xxxx.jpg not the same image file. I want replace all <img src="image
I found this function:
function GetImageSource($strHtml)
{
$strRegExp = '/<img (?:.*?)src=(?:"|\'){1}(.*?)(?:"|\'){1}/is';
$arrMatches = array();
$bolMatched = preg_match_all($strRegExp,$strHtml,$arrMatches);
if( $bolMatched!==false && isset($arrMatches[1]) )
{
return $arrMatches[1];
}
else
{
return false;
}
}
How can I replace all <img src="xxxx.jpg" to <a href="xxxx.jpg><img src="xxxx.jpg" ? xxxx.jpg not the same image file. I want replace all <img src="image