I have a problem with reading string values from $_POST when the value has html tags that use & i.e.  .
Background: My application is an HTML editor. The user edits the document (using jQuery.cleditor) and clicks save. The document is then sent as HTML to my php script as POST with the document content in a "content" variable.
Problem: When the data sent to the php script contains an & symbol as used in some tags ( ) the data arrives OK and looks ok when printed with print_r($_POST) but has a problem when the value is copied to a variable as in:
$content = $_POST['content'];
The problem is that everything after (and including) the first occurrence of & in the string is truncated.
I have spent hours trying to get around this with things like encodeURI and btoa in Javascript before sending the data but it always seems to get that dreaded & somewhere and corrupt the output.
If I strip the & tags out before sending the content the php works just fine.
Am I doing something fundamentally wrong?
Your input on ANY solution to this would be appreciated.
Thanks in advance