(.*)|', $content, $titles); //if there are titles, build the content table if($titles[1]){ $max = count($titles[1]); $counter = 0; $content_table = "

Inhalt

"; } //echo $content_table; //replace the shortcode by the content table $content = str_replace('

'.$m[0].'

', $content_table, $content); //add "back to top" links in headers $content = preg_replace("|<".$in_tag.">(.*)|e", "'<'.$in_tag.' name=\"'.slug('$1').'\" id=\"'.slug('$1').'\">$1Zum Anfang'", $content); endif; return $content; } function slug($string) { $slug = trim($string); $slug= preg_replace('/[^a-zA-Z0-9 -]/','', $slug); // only take alphanumerical characters, but keep the spaces and dashes too... $slug= str_replace(' ','-', $slug); // replace spaces by dashes $slug= strtolower($slug); // make it lowercase return $slug; } ?>