Hi,
Can’t seem to get my head around this one: Every time I use preg_replace(), it’s returning the string with the first letter replaced, but nothing else.
Here’s an example:
$sentence = "I'm trying to filter a @($* last name like Smith-Klein.";
echo preg_replace("/^[a-zA-Z \\'\\-\\.]/", "", $sentence );
I think this should return:
I’m trying to filter a last name like Smith-Klein.
Instead, it’s returning:
'm trying to filter a @($* last name like Smith-Klein.
Any idea where I’m going wrong?
Thanks,
Pavel