i have a problem, for replacing email address from html innertext.
i can replace all email address. but i can't replace only specific(innertext of html). please help me..
i have tried with preg_replace('/[A-Z0-9._%+-]+@([A-Z0-9.-]+.[A-Z]{2,4}|[A-Z0-9.-]+)/iu','[---]',$data)
please help me. thanks...
my input
<div data="example1@dom.com,example4@dom.com"><a href="example1@dom.com" > example4@dom.com, <b>example3@dom.com</b> other text, example7@dom.com, ,<i>example5@dom.com</i></a></div >
expected output:
<div data="example1@dom.com,example4@dom.com"><a href="example1@dom.com" > [--], <b>[--]</b> other text, [--] ,<i>[--]</i></a></div >
live demo
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…