thomashw Posted May 9, 2008 Share Posted May 9, 2008 I have a form that submits double quotes, and I'd like PHP to just display the double quotes (not what it's doing right now.) Here's my code: $optionstring = explode('|', $_POST['option' . $i] ); $option = $optionstring[0]; I'm not sure how to do it, so if anyone can help that'd be great. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted May 9, 2008 Share Posted May 9, 2008 Perhaps it's just me, but i dont understand the question. I have a form that submits double quotes, and I'd like PHP to just display the double quotes (not what it's doing right now.) What do you mean by that? You have a field in your form which sometimes contains double quotes? What do you mean you just like PHP to display the double quotes? My only guess is you wanted to get rid of the forward slash added by magic_quotes? If so, see stripslashes() Quote Link to comment Share on other sites More sharing options...
thomashw Posted May 9, 2008 Author Share Posted May 9, 2008 Yes, I have a form field which can contain double quotes. Currently, the submitted data is displayed up until the double quote and isn't displayed after that. How can I make the double quotes be displayed as well as anything after them? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted May 9, 2008 Share Posted May 9, 2008 Can you show us a bit more of the code you're using? A still dont really follow. Is this the name of a form field? Quote Link to comment Share on other sites More sharing options...
thomashw Posted May 9, 2008 Author Share Posted May 9, 2008 The value of a field is being submitted like this: <option value="thisisanoption|option">Option</option> The explode just gets the first half. Now if there was a quote in there, like this: <option value="this isan"option|option">Option</option> Only "this isan" is displayed. Quote Link to comment Share on other sites More sharing options...
thomashw Posted May 9, 2008 Author Share Posted May 9, 2008 I'm a doofus. Figured it out. htmlspecialchars(); That shouldn't of taken me so long. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.