Domanda

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

È stato utile?

Soluzione

try

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

or

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

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

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

Altri suggerimenti

You can either wrapping " around ' ':

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

or escape it using:

if ($_POST["answer"] == "\"")
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top