PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- $sAlt = 'test';
- $sText = '
- <img src="some_image.png" height="200" width="300">
- some text
- <img src="image.jpg" alt="has alt">
- <img alt=\'alt\'>
- some new text
- <img alt=noquotes src="img.gif">';
- {
- $sResult = $rgMatches[1];
- {
- $sResult = '<img'.$sResult.' alt="'.$sAlt.'"'.'>';
- }
- else
- {
- $sResult = $rgMatches[0];
- }
- return $sResult;
- }, $sText);
- //var_dump($sText);