开发者

I have read the article on how to create the Keyword function to automatically place the keywords in PHP

开发者 https://www.devze.com 2023-02-07 08:45 出处:网络
Where do I need to place that keyword info to get the function to grab it dynamically in 开发者_如何学Pythonthe stored variables?

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消