All pastes #729792 Raw Edit

Mine

public text v1 · immutable
·published 2007-10-08 10:28 UTC
rendered paste body
function bbcode($message) { 
	$input = array(
        '#\[B\](.+?)\[\/B\]#is', 
        '#\[i\](.+?)\[\/i\]#is',
        '#\[U\](.+?)\[\/U\]#is',
        '#\[img\](.+?)\[\/img\]#is',
        '#\[url=(.+?)\](.+?)\[\/url\]#is',
        '#\[color=(.+?)\](.+?)\[\/color\]#is',
		'#\[hide=(.+?)\](.+?)\[\/hide\]#is',
    );
    $output = array(
        '<strong>$1</strong>',
        '<em>$1</em>',
        '<span style="border-bottom: 1px solid;">$1</span>',
        '<img src="$1">',
        '<a href="$1">$2</a>', 
        '<font color="$1">$2</font>',
		'<a href="#" onClick"t_v(\'$1\')">Show/Hide</a><br /><div id="$1" style="z-index:1; display:none;">$2</div>',
    );
    return preg_replace($input, $output, $message);
}