Converting user input for XML-validation
| From: | Ralph Kutschera | Date: | Fri, 16 Nov 2007 10:14:20 +0000 |
| Subject: | Converting user input for XML-validation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-264677@lists.php.net to get a copy of this message | ||
Hallo!
I'm having an HTML-form where the user can input anything. With PHP
I'm processing the input to XML like
<userinput>what the user has entered</userinput>
Now, if the user enters e.g "< thats a bracket", that gives
<userinput>< thats a bracket</userinput>
which of course does not validate.
Is there a standard function in PHP to convert any string for usage with
XML? In the example the string should become "< thats a bracket".
Thanks a lot,
Ralph