Bubble Sort in PHP With Example | How Bubble Sort Works in PHP
PHP com port communication In Hindi | Write on com port in PHP
PHP Interview Questions In Hindi : PHP Interview Preparation
Selection Sort in PHP With Example | How does selection sort work in PHP ?
Web developer roadmap : How to become web developer ? web development kya hai ?
Ternary Operator In JavaScript In Hindi | JavaScript Conditional Operator In Hindi
AWS Create VPC Manually | Create VPC In AWS In Hindi
Java Program to check whether number is Palindrome or not | Java Find Palindrome Number
If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
PHP में null
type एक unit type जिसमे सिर्फ एक ही value है - null
. यह case-insensitive constant value है मतलब इसे आप Null
/ NULL
कैसे भी लिख सकते हैं लेकिन इसे change नहीं कर सकते।
<?php
$x = NULL;
?>
आप null
variable को किसी numeric value से calculation भी कर सकते हैं लेकिन ध्यान रहे इस case में null 0
की तरह work करेगा।
<?php
$num = null;
$num += 10;
echo "{$num} \n";
$num -= 2;
echo "{$num} \n";
$num *= 2;
echo "{$num} \n";
?>
Output :
10 8 16
Important* null values पर increment और decrement operator work नहीं करेंगे।
<?php
$num = null;
++$num; // null
$num++; // null
$num--; // null
--$num; // null
?>
किसी empty Array को आप null से compare भी कर सकते हैं , लेकिन ध्यान रहे non-strict equal (==)
के साथ compare करने पर आपको true
मिलेगा जबकि strict equal (===)
compare करने पर false
.
For Example
<?php
$arr = [];
echo $arr == null ? "true" : "false";
echo "\n";
echo $arr === null ? "true" : "false";
?>
Output :
true false
कोई variable null
है या नहीं ये check करने के लिए is_null()
function का use किया जाता है।
<?php
$x = null;
echo is_null($x) ? "true" : "false";
?>
Output :
true
I Hope, अब आप PHP men null के behavior के बारे में अच्छे से समझ गए होंगे।
Loading ...
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook