Thank you for the reply.That works.
But i need some further help..
I want to replace all the tags <if test=0>content</if> with nothing.That means i want to erase them.
If <if test=1>content</if> then replace that with content.
Your regex works fine but if there are nested tags it becomes a mess.
<if test=1>pasok
<if test=0>b</if>
<if test=1>a</if>
s</if>
So the only solution i think is to replace the most inner tags first and repeat the preg_replace.
But i cant find any good regex.
echo preg_replace("/<if test=0>(.)*?(?!<if)(.)*?<\/if>/s","",$pap,1);
this for example wouldnt work because for example <if test=0>b</if> wouldnt match because after that there is an <if test=1>a</if>
any help apreciated