Simple php if query to double check

Posted by skarama on Stack Overflow See other posts from Stack Overflow or by skarama
Published on 2009-12-08T19:31:47Z Indexed on 2010/05/09 5:08 UTC
Read the original article Hit count: 136

Filed under:
|

Is anything wrong with this code?

<?php

$variable = ;

if (isset($variable))

{

echo $variable ;
echo "also this" ;

}

else

echo "The variable is not set" ;

?>

also, the other potential value of the variable is :

$variable = <a href="http://www.mysite.com/article">This Article</a>;

To clarify, I have a variable that may hold one of two possible values : an a href tag with it's url, or notihng at all. I need to have two different printouts for each of these cases, maybe I'm not doing it the right way though!

© Stack Overflow or respective owner

Related posts about php

Related posts about if-statement