A couple of possible solutions:
function str_replace_special_1($str)
{
$search = array('\\', "'", '$', '%', '#', '@',
'!', '&', '^', '*', '(', ')', '-');
foreach ($search as $replaceable) {
if (substr($str, 0, 1) == $replaceable) {
$str = substr_replace($str, '', 0, 1);
}
}
return $str;
}
function str_replace_special_2($str)
{
$search = array('\\', "'", '$', '%', '#', '@',
'!', '&', '^', '*', '(', ')', '-');
$str_1 = substr($str, 0, 1);
$str_2 = substr($str, 1);
$str_1 = str_replace($search, '', $str_1);
return $str_1 . $str_2;
}