Hello there,
how to cut a certain group of words in a string, for example,
"<img src='images/smiles/grin.gif' smilietext=':gr in:' border='0'
style='vertical-align:middle' alt=':grin:' title=':grin:' />"
"<img src='images/smiles/smile.gif' smilietext=': smile:' border='0'
style='vertical-align:middle' alt=': smile:' title=': smile:' />"
¡..
from a forum comment.
I tried this:
$subject =$row_Recordset 2['pagetext']
$pattern="/<img src='images\/smiles\/[a-zA-Z]+\.gif' smilietext=':[a-zA-Z]:'
border='0' style='vertical-align:middle' alt=':[a-zA-Z]:' title=':[a-zA-Z]:'
\/>/";
$result = preg_replace($p attern,"",$subj ect);
But I failed, I am new to PHP, please help. Thanks very much in advance.
logically, is it a better way to search for all what is inside the <img ...
/tag (including numbers) and replace them with ""?
I will write: $pattern="/<img [a-zA-Z][0-9]>\/>/", is it correct? Thank you
for your help.
how to cut a certain group of words in a string, for example,
"<img src='images/smiles/grin.gif' smilietext=':gr in:' border='0'
style='vertical-align:middle' alt=':grin:' title=':grin:' />"
"<img src='images/smiles/smile.gif' smilietext=': smile:' border='0'
style='vertical-align:middle' alt=': smile:' title=': smile:' />"
¡..
from a forum comment.
I tried this:
$subject =$row_Recordset 2['pagetext']
$pattern="/<img src='images\/smiles\/[a-zA-Z]+\.gif' smilietext=':[a-zA-Z]:'
border='0' style='vertical-align:middle' alt=':[a-zA-Z]:' title=':[a-zA-Z]:'
\/>/";
$result = preg_replace($p attern,"",$subj ect);
But I failed, I am new to PHP, please help. Thanks very much in advance.
logically, is it a better way to search for all what is inside the <img ...
/tag (including numbers) and replace them with ""?
I will write: $pattern="/<img [a-zA-Z][0-9]>\/>/", is it correct? Thank you
for your help.
Comment