header("content-type: text/html; charset=utf-8");
ob_start();
echo "\n";
?>
// Maakt een URL-vriendelijke 'slug'
// Er vanuitgaand dat je source bestand in UTF-8 is opgeslagen en de Content-Type van je output ook UTF-8 is
function slug($title) {
$title = html_entity_decode($title, ENT_QUOTES);
$title = strtr($title,
utf8_decode('ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ'),
'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy');
$allowed = "abcdefghijklmnopqrstuvwxyz0123456789-";
$out = "";
$t = strtolower(html_entity_decode($title));
$l = "";
for($i = 0; $i < strlen($t); $i++) {
$c = $t[$i];
if($c == " ") $c = "-";
if(strpos($allowed, $c) !== false) {
if(!($l == "-" && $c == "-")) {
$out .= $c;
}
$l = $c;
}
}
return $out;
}
echo "?>\n";
$c = ob_get_contents();
ob_end_clean();
highlight_string($c);
?>