If I understand the question correctly, do you want to remove " from $inputData['title'] so that your HTML code is not corrupted?
If so, the โrightโ solution is not to remove the double quotes, but to escape them before the actual output.
Given that you are generating HTML , you should use the htmlspecialchars function ; thus, double quotes (and several other characters) will be encoded for HTML objects and will not cause any problems when entering HTML into your markup.
For instance:
echo '<input name="title" type="text" class="inputMedium" value="' . htmlspecialchars($inputData['title']) . '" />';
Note: depending on your situation (especially about the encoding / encoding you can use), you can pass some additional parameters to htmlspecialchars .
Generally speaking, you should always avoid the data you send as output, no matter what output format you have.
For instance:
source share