

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Double not (!!) operator in PHP
In the Double not operator (!!), the first not i.e. ! is used to negate a value, whereas the second not i.e.! again negates. To implement Double not operator in PHP, the code is as follows−
Example
<?php $str = "0.1"; echo "Value = $str"; $res = !!$str; echo "\nDouble Negated Value = $res"; ?>
Output
This will produce the following output−
Value = 0.1 Double Negated Value = 1
Example
Let us now see another example −
<?php $str = "100.56"; echo "String = $str"; $num = floatval($str); echo "\nNumber (Converted from String) = $num"; $res = !!$num; echo "\nDouble Negated Value = $res"; ?>
Output
This will produce the following output−
String = 100.56 Number (Converted from String) = 100.56 Double Negated Value = 1
- Related Questions & Answers
- What does double question mark (??) operator mean in PHP ?
- What is the Kotlin double-bang (!!) operator?
- Is the !! (not not) operator in JavaScript equivalent to reverse process of not operator?
- Apply Ternary operator on double value in Java
- PHP Execution Operator
- PHP Operator Precedence
- What is the !! (not not) operator in JavaScript?
- What is double address operator(&&) in C++?
- What does the Double Star operator mean in Python?
- Nullsafe Operator in PHP 8
- PHP Scope Resolution Operator (::)
- PHP Error Control Operator
- What is the "double tilde" (~~) operator in JavaScript?
- Is there a PHP function that only adds slashes to double quotes NOT single quotes
- Difference between !== and ==! operator in PHP
Advertisements