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 ! 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