Meta Tags
Moderator: General Moderators
Meta Tags
I dont quite understand php nor how it works, so I wanted to ask can html be placed inside those tags of php, or does the html have to reside on the outside of the tags of php?
I ask this as I wanted to know where to place meta-tags for the index.php?
Thank you.
JF3000
I ask this as I wanted to know where to place meta-tags for the index.php?
Thank you.
JF3000
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
That'll do.
Just because you are using PHP, doesn't mean you should echo / print stuff for the sake of it.
If you can do it outside of the <?php ?> tags then that's the best (and I beleive fastest) way to do.
Examples:
You can echo anything, be it, words, <tags>, JavaScript or anything that shows in the web page source code. Just depends if you needs to use the PHP to do it or not. I do it outside of <?php ?> wherever possible (if it's not dynamic content).
Just because you are using PHP, doesn't mean you should echo / print stuff for the sake of it.
If you can do it outside of the <?php ?> tags then that's the best (and I beleive fastest) way to do.
Examples:
Code: Select all
//Doing it outside <?php ?>
<?php
$name = 'Chris';
$age = '21';
?>
<!-- This is HTML -->
<span>My name is <?php echo $name; ?> and I am <?php echo $age; ?> years old.</span>
//Doing it all inside <?php ?>#
<?php
$name = 'Chris';
$age = '21';
echo '<span>My name is ';
echo $name;
echo ' and I am ';
echo $age;
echo ' years old.</span>';
?>