PHP object Type Casting In Hindi | PHP object In Hindi
PHP Security Tips : Hiding php In URL (In Hindi)
PHP Interview Questions In Hindi : PHP Interview Preparation
Selection Sort in PHP With Example | How does selection sort work in PHP ?
Promise In JavaScript In Hindi | JS Promise constructor
what is switch ? And How switch works ?
What is Modem ? and How Modem works?
Best Keyboards Under 1000 Available On Amazon
Understanding setTimeout In JavaScript | JS setTimeout In Hindi
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 In Hindi
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 ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook