Can anyone explain why this:
if($xml->$ul !== ""){
echo $xml->$ul;
}
if($xml->$ul == ""){
echo "0";
}
does work, while
if($xml->$ul !== ""){
echo $xml->$ul;
}else{
echo "0";
}
does not work? Am i missing something?
Short explanation: if the xml contains $ul it will echo its value, if it is not contained it will echo 0. Works perfectly with first code, but second code just echos the values, the else is completely ignored.
I appreciate all answers!