g1c9 Posted February 28, 2006 Share Posted February 28, 2006 Hey,I am trying to display html between php code brackets if and only if a variable is set. For example:[code]<?php if ($some_var == 1) { echo(' ?> if some_var is equal to 1 then this will display, otherwise it wont!<?php '); }?>[/code]Is this even possible? Please help me achieve this!Thanks in advance,Cameron Link to comment https://forums.phpfreaks.com/topic/3718-starting-and-ending-code-in-different-php-scripts/ Share on other sites More sharing options...
AndyB Posted February 28, 2006 Share Posted February 28, 2006 [code]<?php.....if ($somevar==1) {?><table><tr><td>Look, Ma. Just html here</td></tr></table><?php}// some more php code?>[/code] Link to comment https://forums.phpfreaks.com/topic/3718-starting-and-ending-code-in-different-php-scripts/#findComment-12929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.