A client of mine writes, “Take a look at the personal message (from our web form) on the quote below….what is happening with the characters in those fields. I believe there was likely abbreviation for foot: 8’”

Cause: This is typically caused by someone creating string of text in Microsoft Word and then pasting it into a web form.

Solution: Set up the following search and replace parameters in your PHP script:

$search = array("\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x98", "\xe2\x80\x99"); 
$replace = array('"', '"', "'", "'"); 

$formmessage = str_replace($search, $replace, $_POST['message']);

Leave a Reply