Aymane Shuichi Aymane Shuichi - 7 months ago 22
PHP Question

How does PHP interpret Javascript's Null value?

Sol let's suppose that we send a post query to a PHP file,
this query where we have ...&title=title
where title is for example

(assuming we're including Jquery)
in PHP we have

Let's suppose then that title is null , will PHP consider null as string ? or something empty ?


From the PHP Manual:

The special NULL value represents a variable with no value. NULL is the only possible value of type NULL.

A variable is considered to be NULL if:

  • it has been assigned the constant NULL.
  • it has not been set to any value yet.
  • it has been unset().

"NULL" is not the same as NULL.

var_dump("null" == NULL);