Is there any way to use HTML in php if statements? Like for example: <html> <?php if (1=1) { <input type "text" id="test" /> } else { <input type="submit" id="submit" value="submit" /> } ?> </html>
<html> <?php if (1=1) { ?> <input type "text" id="test" /> <?php } else { ?> <input type="submit" id="submit" value="submit" /> <?php } ?> </html> hope it helps
The other way is <?php echo '<html>'; if (1=1) { echo '<input type "text" id="test" />'; } else { echo '<input type="submit" id="submit" value="submit" />'; } ?> </html> PHP: