i try filter a text that contain html tags , i want filter <a>
tags from inner text of <a>
i try
string:
<li><a href='abc'>one</a></li><li><a href='cde'>two tag</a></li><a href='fgh'>tag three</a></li><a href='ijk'>four</a></li>
php :
preg_match_all("/\<a.*?href(?:\=|\s\=)(?:\\"|\')(.*?)(?:\\"|\').*?\>[^\/]*tag\<\/a\>/", $input_lines, $output_array);
result :
array(1
0 => abc
)
correct answer is like below
array(1
0 => cde,
1 => fgh
)
what is wrong and how can get correct result
Advertisements