$ single dollar and $$ double dollar mean in PHP in Hindi | PHP $ and $$ Variables in Hindi

आज हम php सिखने की इस सीरीज में $ single dollar and $$ double dollar mean in PHP in Hindi/ PHP $ and $$ Variables in Hindi  आदि के बारे में पढ़ेंगे। इस टॉपिक को पढ़ने से पहले में Hindi me IT में आपका बहुत बहुत अभिनान्दन हैं।

$ single dollar and $$ double dollar mean in PHP in Hindi | PHP $ and $$ Variables in Hindi

$a (single dollar) a नाम का एक normal variable हैं, जो की string, integer, float जैसी value को strore करता हैं। $$a (double dollar) एक reference variable हैं। जो की value को store करता हैं।

Variable Variables:- Variable Variables एक वेरिएबल ही होते हैं जिनके नाम dynamically रूप से दूसरे variable की value से बनाये जाते हैं।

इसे नीचे दिये गए image से आसानी से समझा जा सकता हैं।

  • $a variable string value “Hindi” को store करता हैं।
  • उसके बाद reference variable $$a एक string value “me IT” को store करता हैं।

$ single dollar and $$ double dollar mean in PHP in Hindi

    अब, “me IT” की value को इस तरीके से एक्सेस किया जा सकता जो की इस प्रकार हैं।

    1. सीधा Reference variable के व्दारा एक्सेस किया जा सकता: उदाहरण echo $$a

    इसके कुछ Example को समझते हैं।

    Input : $a = "Hindi";  
            $a = me IT;  
            echo "$a ";  
            echo "$a;";   
            echo $Hindi;
    Output : Hindi 
             me IT
             me IT
    
    Input : $a = "Shreekant";  
            $a = "trilokpur";  
            echo "$a lives in " . $Shreekant;
    Output : Shreekant lives in trilokpur

    Example 1

    <?php
    // Declare variable and initialize it
    $a = "Hindi";	
    
    // Reference variable
    $$a = "HindimeIT";
    
    // Display value of a
    echo $a . "\n";
    
    // Display value of $$a ($Geeks)
    echo $$a . "\n";
    
    // Display value of $Geeks
    echo "$Hindi";
    
    ?>

    Output

    Hindi
    HindimeIT
    HindimeIT

    Example 2

    <?php
    
    // Declare variable and initialize it
    $a = "Hindi";
    
    // Reference variable
    ${$a}="HindimeIT";
    
    // Use double reference variable
    ${${$a}}="computer";
    
    // Display the value of variable
    echo $a . "\n";
    echo $Hindi . "\n";
    echo $HindimeIT . "\n";
    
    // Double reference
    echo ${${$a}}. "\n";
    
    ?>

    Output

    Hindi
    HindimeIT
    computer
    computer

    refrence By:- https://www.geeksforgeeks.org/what-does-dollar-dollar-or-double-dollar-means-in-php/

    Conclusion

    इस आर्टिल्स में हमने सीखा $ single dollar and $$ double dollar mean in PHP in Hindi/ PHP $ and $$ Variables in Hindi

    दोस्तों मैं आशा करता हूँ कि आपको ये जानकारी पसंद आयी होगी और यदि ये जानकारी आपको पसंद आयी हो तो इस जानकारी को अपने दोस्तों के साथ शेयर करे ताकि उनको भी $ single dollar and $$ double dollar mean in PHP in Hindi/ PHP $ and $$ Variables in Hindi  को जानने हेल्प मिलेगी।

    अगर आपको अभी भी $ single dollar and $$ double dollar mean in PHP in Hindi/ PHP $ and $$ Variables in Hindi  से संबंधित कोई भी प्रश्न या Doubt है तो आप कमेंट्स के जरिए हमसे पुछ सकते है। मैं आपके व्दारा पूछा गये सभी सवालों का जवाब दूँगा।

    अगर आपको हमारे व्दारा दी जानकारी पसंद आती हैं और आप  ,Computer Science, इंटरनेट, IT, मॉडल टेक्नोलॉजी और new जानकारी पढ़ना अच्छा लगता हैं. तो आप हमारे इस ब्लॉग को जरूर सब्सक्राइब कर कर लो | अगर आपका हमको कोई नया सुझाब देना हैं तो वह भी बताये।

    Related Posts

    Leave a Comment