Jump to content

Archived

This topic is now archived and is closed to further replies.

otha

variable

Recommended Posts

Anyone have an idea why this won't work as a variable
<?
$topOpen=
if ($offsetf== top )
{ echo $desireda  .'  Mils, Open at the top';}
else
{ echo abs(-$desireda)  .'  Mils, Open at the bott.';}
;
?>

Share this post


Link to post
Share on other sites
You seem to be assigning $topOpen the results of an if else.

which should get you an error of

PHP Parse error:  parse error, unexpected T_IF in ...

Share this post


Link to post
Share on other sites
<?
$topOpen= ($offsetf== "top");
if($topOpen)
{ echo $desireda  .'  Mils, Open at the top';}
else
{ echo abs(-$desireda)  .'  Mils, Open at the bott.';}
;
?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.