Dealing with Empty Tags in XML via PHP

Hello,

Wondering if anyone can help me … I’ve been working with the Parsing XML with PHP tutorials and they work great - but i have a question… I don’t know how to get PHP to deal with empty XML tags… ?

I’ve tried various if statements but i cann’t get PHP to recognise that the parsed $data variable is empty! :

function contents($parser, $data){

if(empty($data)){
echo(“empty + CALL my function”);
}else{
echo($data);
}
} …if(strlen($data) > 0) errr " != " …errr == “”…errr

any help would be gratefully received :wink:

thanks ,

M