Why isn't this code working?
<?php
function code($str)
{
$str = htmlspecialchars($str);
$str = ereg_replace("[","<",$str);
$str = ereg_replace("]",">",$str);
return $str;
}
$mes = code($text);
echo $mes;
?>
This code outputs:
Warning: REG_EBRACK: in C:\Path\file.php on line 11
Line 11 is:
$str = ereg_replace("[","<",$str);
Please help a stupid newbie!