otha Posted September 28, 2006 Share Posted September 28, 2006 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.';};?> Link to comment https://forums.phpfreaks.com/topic/22332-variable/ Share on other sites More sharing options...
warewolfe Posted September 28, 2006 Share Posted September 28, 2006 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 ... Link to comment https://forums.phpfreaks.com/topic/22332-variable/#findComment-100030 Share on other sites More sharing options...
otha Posted September 28, 2006 Author Share Posted September 28, 2006 That is what I am trying to do but I get a parse error Link to comment https://forums.phpfreaks.com/topic/22332-variable/#findComment-100034 Share on other sites More sharing options...
extrovertive Posted September 28, 2006 Share Posted September 28, 2006 <?$topOpen= ($offsetf== "top");if($topOpen){ echo $desireda .' Mils, Open at the top';}else{ echo abs(-$desireda) .' Mils, Open at the bott.';};?> Link to comment https://forums.phpfreaks.com/topic/22332-variable/#findComment-100035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.