session_start(); ## https://stackoverflow.com/questions/1960461/convert-plain-text-urls-into-html-hyperlinks-in-php function formatText($text) { $text = html_entity_decode($text); $text = " ".$text; //Links with protocol $reg = '/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(\/\S*)?/'; $text = preg_replace($reg, '$0', $text); $emailRegex = '/(\S+\@\S+\.\S+)\b/'; $text = preg_replace($emailRegex, '$1', $text); //Links without protocol $reg2 = '/(?<=\s|\A)([0-9a-zA-Z\-\.]+\.[a-zA-Z0-9\/]{2,})(?=\s|$|\,|\.)/'; $text = preg_replace($reg2, '$0', $text); $text=nl2br($text); return $text; } if ($_SESSION["PROJ_ACCESS"]=="Y") { $link["sparkling_science"]="Sparkling Science"; $link["iamhere"]="I AM HERE! - Partizipative Ansätze zum Raumverhalten von Jugendlichen in der Stadt"; $link["bmwf"]="Bundesministerium für Wissenschaft und Forschung (BM.W_F)"; } if ($_SESSION["PROJ_ACCESS"]=="N") { $link["sparkling_science"]="Sparkling Science"; $link["iamhere"]="I AM HERE! - Partizipative Ansätze zum Raumverhalten von Jugendlichen in der Stadt"; $link["bmwf"]="Bundesministerium für Wissenschaft und Forschung (BM.W_F)"; } ?>
echo formatText($_SESSION["PROJECT"]["INFO"]); ?>