Forums :: Test Forum :: Testing New [code] Feature

16th August 2005 10:16:11 GMT
Testing New [code] Feature
Rob
Rob's avatar

Seraphic/8X
85 post(s) since
24th November 2004 22:22:29 GMT
/piccies/Worms%202%20-%20Bazooka.jpg
"Prepare for an oblivion for which there is no preparation." - O'Malley (Red Vs Blue)
16th August 2005 14:50:03 GMT
Testing New [code] Feature
Rob
Rob's avatar

Seraphic/8X
85 post(s) since
24th November 2004 22:22:29 GMT
Version  1.0:

    $matchCount = preg_match_all("/\[code\](.*?)\[\/code\]\", $text, $matches);

    for($a=0; $a<$matchCount; $a++)
    {      $replacement = str_replace(array("[", "]"), array("[", "]"), $matches[1][$a]);
      $text = str_replace($matches[0][$a], $replacement, $text);
    }


This simply swaps square brackets for their ASCII equivalents.
"Prepare for an oblivion for which there is no preparation." - O'Malley (Red Vs Blue)

Add Post

You must be Archangel/1B or greater to add posts to this thread.

Valid XHTML 1.1 Strict Valid CSS