Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

I want to escape double quotes in input value.

Hi, Thanks in advance. I want to escape double quotes in input value. I have already used bind in insert and update command. But when i select the value from the table to display in input field. i am not able to see the correct value. For eg - <input type="text" name="module_name" value="<?php echo $module_name";?>">. I am not able to escape double quotes in the value.

3 Answers

This i have already tried. I want the exact value as i entered. I do not want user to see the backslash in the output.

Without seeing your data it's hard to decide what the right method would be for you. But if you have special characters present in your data then perhaps escaping them to HTML entities would be sufficient. You can use htmlentities