Please suggest me PHP regex for preg_replace to remove just all the attributes from HTML tags except <a> tag.
I tried already:preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>',$htmltext);
It works fine for all the HTML tags but for <a> tag it removes href, title and target attributes.
Please suggest me the required changes in above regex or please share the working one.
Thanks in advance.
THE PONY HE COMES.