<?php if($_SESSION['log']!=''){ $msg = preg_replace('|\[hide\](*?)\[\/hide\]|i', '[hidden message: \1 ]', $msg); }else{ $msg = preg_replace('|\[hide\](*?)\[\/hide\]|i','[hidden message]', $msg); } ?>