I'm trying to write meta keywords dynamically with php, so I have such a code , running in WAMP Server localhost/myfile.php :
<meta name="keywords" content="keyword1, keyword2,
<?php
echo $my_array['index_of_keyword3'];
?>
">
well of course it results in this:
<meta name="keywords" content="keyword1, keyword2,<?php echo $my_array['index_of_keyword3']; ?> ">
So what should I do to get
<meta name="keywords" content="keyword1, keyword2,keyword3 ">
?
Thanks !
By the way, I know I could do this with something like
<?php echo "<meta name=\"keywords\" content=\"keyword1, keyword2,$myVariable\">"; ?>
But I would like to simplify my code, by using php only for the variables.
Edit: omg, I solved the problem by seeing that I'm an idiot :)
I have wrote <?php$row=blabla..?>
changing it to <?php $row=blabla..?> solved the issue.
Thanks for all the answers. I will upvote them all.
<?php echo "Hello World!"; ?>- Did you try the extenstion .php5 instead of .php? Is the address http:// or file:///??