0

Hi can anyone tell me what's wrong with this?

Thx in advance.

$meta_tags = '<meta name="keywords" content="' .$meta_keywords' . ">
<meta name="description" content="' .$meta_keywords . '">';

Its throwing the following error:

PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Airshow
0

Try this

meta_tags = "<meta name="keywords" content="".$meta_keywords."">
<meta name="description" content="".$meta_keywords."">";
0

kk29 is right, it's just a question of getting those devilish quotes in the right place.

By the way, the line break between tags won't appear as a line break in the served html. For that you need to embed "\n" (note the double quotes).

For multi-line output, this is a useful technique:

$outputStr = array();
........
........
$outputStr[] = '<meta name="keywords" content="' . $meta_keywords . '">';
$outputStr[] = '<meta name="description" content="' .$meta_keywords . '">';
........
........
$outputStr[] = 'whatever';
$outputStr[] = 'whatever';
........
........
print implode("\n", $outputStr);

Airshow

0

Ah!!!! blooming single quote out of place !!!

My bad :)

Thx for the help AIRSHOW and kk2929 - sometimes can't see for looking

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.