Jump to content

Archived

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

g1c9

Starting and Ending Code In Different PHP Scripts?

Recommended Posts

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

Share this post


Link to post
Share on other sites
[code]<?php
.....
if ($somevar==1) {
?>
<table><tr><td>
Look, Ma. Just html here
</td>
</tr>
</table>
<?php
}
// some more php code

?>[/code]

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.