I am generating radio buttons based on an XML config values. Sometimes they have apostrophes in the text. When manipulating this data in PHP, I seem to lose everything after
You can use double quotes to surround the text:
An even better way would be to replace the apostrophes with '.
This is a more robust solution in case the text includes double quotes as well. You should replace all 's with 's and "s with "s.
This can be easily done using htmlspecialchars(string $str). http://php.net/manual/en/function.htmlspecialchars.php