سؤال

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

هل كانت مفيدة؟

المحلول

try

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

or

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

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

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

نصائح أخرى

You can either wrapping " around ' ':

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

or escape it using:

if ($_POST["answer"] == "\"")
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top