PHP Constants in Hindi - Constants in PHP in Hindi

 PHP Constants in Hindi - Constants in PHP in Hindi इस Tutorial में PHP Constants in Hindi या Constants in PHP in Hindi को पढ़ेंगे।  

PHP Constants in Hindi


PHP Constants PHP में काफी Important Part है, जिसे सही से जानना आपके लिए आवश्यक है, तो चलिए जानते है। 

PHP Constants in Hindi

Constants एक प्रकार का name या फिर Identifier होता है।  Constants की Value को Change नहीं किया जा सकता है। जिस प्रकार किसी Variable में Value को Add करते है। उसी प्रकार Constants Value भी दी जाती है। लेकिन Constants Variable को Create करने का तरीका अलग है।  इसके लिए Define() function का Use किया जाता है। 

Syntax of PHP Constants in Hindi 


<?php
define(name, value, case-insensitive)
?>

 सबसे पहले Define()  Function को Create किया जाता है, इस Function में name, Value, case-insensitive ये         Parameter दिए जाते है।  ये parameter देना आवश्यक है। 

1. name, यहाँ पे हमें Constant Variable का नाम देना होता है, जो भी हम अपने Constant Variable का नाम          रखना चाहे।  
2. इसमें हमें Constant की Value देनी होती है। 
3. इसमें case-sensitive या case-insensitive PHP Constant variable create कर रहे है।  ये बताना होता है। यानि        दोनों तरह का Variable Create कर सकते है। अगर इसमें कुछ नहीं देते है।  तो Case - Sensitive Constant होगा।  अगर True कर देते है।  तो case - insensitive होगा। 

अब यहाँ पे Constant Variable का एक Example देखते है।  


<?php
// case-insensitive constant name
define("Great", "Great Go Tips", true);
echo GREAT;
?>

Output
 
Great Go Tips

ये एक Case - Insensitive Variable है।

Case Sensitive Variable 


<?php
// case-sensitive constant name
define("Great", "Great Go Tips");
echo Great;
?>

Output 

Great Go Tips 

 ये एक Case - Sensitive Constant है।

 PHP Constant और Variable में अंतर



Constant Variable 
Constantएक Identifier या फिर एक name है।  जिसमे हम simple Value add कर सकते है और Constant में दी गयी 
Value को Change नहीं किया जा सकता है।   
 Variable एक Symbol होता है।  
जिसमे हम कई प्रकार की Value 
को Store करा सकते है , जैसे - 
Float , String , Character , Numeric 
इसको बिना Function के द्वारा Use नहीं किया जा
 सकता है। इसको Use करने के लिए Define()
Function Use किया जाता है। 
इसको बहुत ही Simple तरीके से Use कर सकते है। 
Constant में $ Sign का Use नहीं होता है।  Variable में सबसे पहले $Sign का Use किया जाता है। 

Comments

Popular posts from this blog

Mazda Pickups Playing It Up In The Us Market

Types of Computer Based on Size in Hindi (आकर के आधार पर Computer के प्रकार )

Finding A College Scholarship For A Single Mother