Originally posted by Kaptai
I've just started learning PHP and I have a question. I'm running XAMPP and just echoing a variable into a paragraph. This paragraph element still displays regardless of whether I put it inside <HTML> or <BODY> tags? In PHP do you need to declare HTML and BODY or do you just write markup wherever you like?
If this is in the wrong area I apologize
Anything not enclosed within <?php and ?> tags are considered markup. See example below;
<?php
$age = 10;
?>
<b><?php echo $age; ?></b>
The code is kind of useless but it's an example, $age = 10 is PHP and enclosed in PHP tags. After that we're using HTML code using bold tags and echoing age in php tags again. I hope you kind of understand what I'm trying to illustrate here.