Copying text from pdf into xml via simpleXML



i am a newbie so be gentle with me.


i have a textarea in an HTML form the contents of which is added to an xml document via simpleXML like this:


$theAnswer = strip_tags($_POST[$theQuestion]); $newAnswer=$newAnswerGroup->addchild('answer',$theAnswer);


$theAnswers->asXML('answers.xml');


If I manually type my text into the textarea it works fine. Problem is that the text I want to add is pasted from a pdf document and when I do that the text is often (but not always) not added to the xml with no explanation or error message. (I am the only person who will ever use this form.)


How do I fix this? Are some disallowed characters coming thru when I paste? I have tried trim, htmlspecialchars($theAnswer, ENT_QUOTES, 'utf-8') and saving the pdf as text and copying from there but had the same problem.


No comments:

Post a Comment