john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

php file listing header

<?php
    echo "<head>\n";

    $info = pathinfo($_SERVER['PHP_SELF']);

    $filename = basename($info['basename'], '.'.$info['extension']);
    $keywords = explode( "-", $filename );
    $title = implode(" ", $keywords);

    $dir_arr = explode( "/", $info['dirname'] );

    $reverse_dir_arr = array_reverse( $dir_arr);
    $dirnames_as_metas = implode("-", $reverse_dir_arr);
    $dirnames_as_metas = explode( "-", $dirnames_as_metas );
    $dirnames_as_metas = implode(" ", $dirnames_as_metas);



    echo "<title>" . $title . "</title>\n";

    echo '<meta name="description" content="';
        echo $dirnames_as_metas . $title;
    echo '" />' . "\n";
    echo '<meta name="keyword" content="';
        echo $dirnames_as_metas . $title;
    echo '" />' . "\n";

    echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';

    echo "</head>\n";
?>

  • « drupal 08 users and roles and permissions
  • grank topten php »

Published

Feb 6, 2010

Category

web

~62 words

Tags

  • file 92
  • header 2
  • listing 9
  • php 82
  • web 56