54.147.17.95 |    

Navigation

Google Advertisement

Die Funktion code2html() wandelt Platzhalter in HTML Code um (Stichwort: Wiki Syntax).

code2html
  1. function code2html($text) {
  2. $text=eregi_replace("\[B\]([^\[]+)\[/B\]", "<b>\\1</b>", $text);
  3. $text=eregi_replace("\[I\]([^[]+)\[/I\]", "<i>\\1</i>", $text);
  4. $text=eregi_replace("\[URL\]www.([^\[]+)\[/URL\]", "<a href=\"http://www.\\1\" target=\"_blank\">www.\\1</a>", $text);
  5. $text=eregi_replace("\[URL\]([^[]+)\[/URL\]", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $text);
  6. $text=eregi_replace("\[MAIL\]([^[]+)\[/MAIL\]", "<a href=\"mailto:\\1\">\\1</a>", $text);
  7. $text=eregi_replace("\[URL=http://([^[]+)\]([^[]+)\[/URL\]", "<a href=\"http://\\1\" target=\"_blank\">\\2</a>", $text);
  8. $text=eregi_replace("\[URL=([^[]+)\]([^[]+)\[/URL\]", "<a href=\"http://\\1\" target=\"_blank\">\\2</a>", $text);
  9. return $text;
  10. }
Parsed in 0.010 seconds at 69.01 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)