Question

I want to be able to read quotes as quotes in my input field so how do I make this work in php:

if ($_POST["answer"] == """ )

right now all I get is a parse error

Was it helpful?

Solution

try

if ($_POST["answer"] == '"')

or

if ($_POST["answer"] == "\"")

maybe apache or php escaping " from $_POST, then use

if ($_POST["answer"] == '\"')

OTHER TIPS

You can either wrapping " around ' ':

if ($_POST["answer"] == '"'

or escape it using:

if ($_POST["answer"] == "\"")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top