I have read the article on how to create the Keyword function to automatically place the keywords in PHP
Where do I need to place that keyword info to get the function to grab it dynamically in 开发者_如何学Pythonthe stored variables?
function get_headers() {
// here set $title, $description and $keywords according to current page
// ....
// then just generate html
$html = "<title>$title</title>";
$html .= "<meta name='description' content='$description' />";
$html .= "<meta name='keywords' content='$keywords' />";
return $html;
}
I hope thats not too bonehead. lol
If your using a function it makes more sense to pass those into the function as arguments:
function get_headers($title, $description, $keywords) {
// then just generate html
$html = "<title>$title</title>";
$html .= "<meta name='description' content='$description' />";
$html .= "<meta name='keywords' content='$keywords' />";
return $html;
}
精彩评论