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.
defined() function check करता है कि दिया गया constant define किया गया है या नहीं।
defined() function सिर्फ constant की existency check करता है , normal variables के लिए isset() use किया जाता है।
defined ( string $name );
string $name | required : constant name जिसे आपको check करना है।
Return Value : अगर constant define किया गया है तो true return होता है otherwise false .
File : php_defined.php
<?php
if(defined('NAME'))
echo 'NAME is defined';
else
echo 'NAME is not defined';
/*now define it*/
define('NAME', 'Rahul Kumar Rajput');
echo "<br />";
if(defined('NAME'))
echo 'NAME is defined';
else
echo 'NAME is not defined';
?>
NAME is not defined NAME is defined
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