Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Wrapping Up The Project Validating Contact Form Data

Anas Mourad
Anas Mourad
14,817 Points

The "!==" operator

First, I know that the "===" operator returns true when both operands have the same type and value, but its the first time to see the "!==" operator. What does it mean?

Second, why are we searching for "Content-Type" string only?. I know malicious inputs come in different forms.

And thanks in advance.

1 Answer

It's the direct opposite of ===. So it returns true if the compared entities are not equal OR not of the same type.

Think of it as == compared to !=. The exclamation mark negates.

Anas Mourad
Anas Mourad
14,817 Points

Thanks Christian for your help. Do you have any Idea why are we searching for string "Content-Type" only?

Patrick Cooney
Patrick Cooney
12,216 Points

You'll hear or see it referred to as a strict equals. Strict referring to the both the value and type matching as Christian stated.