Skip to main content

Posts

Showing posts with the label PHP references

Introduction to PHP References part ๐Ÿ‘‰12

  PHP references  Introduction to PHP References PHP เคฎें references เค•ा เค…เคนเคฎ role เคนोเคคा เคนै। References เค•ो เค…เคฒเค— เค…เคฒเค— purposes เค•े เคฒिเค program เคฎें เคฏूเคœ़ เค•เคฐ เคธเค•เคคे เคนै। เคฏे pointers เค•ी เคคเคฐเคน เคจเคนीं เคนोเคคे เคนै। เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค เคจिเคšे เคฆिเค เคนुเค program เค•ो เคฆेเค–िเคฏे।  <?php // Creating reference $a =& $b; $a = "Indian"; // It will print Indian echo $a; // It will also print Indian echo $b; ?> เคŠเคชเคฐ เคฆिเค เคนुเค program เคฎें เคœเคฌ เคฆोเคจों variables เค•ी value print เค•ी เคœाเคคी เคนै เคคो เคฆोเคจों same value print เค•เคฐเคคे เคนै เค•्เคฏोंเค•ि เคฆोเคจों เคเค• เคนी value เค•ो refer เค•เคฐ เคฐเคนे เคนै। Passing Undeclared Variable เคฏเคฆि เค†เคช เค•िเคธी เคเคธे variable เค•ो assign, pass เค”เคฐ return เค•เคฐเคจे เค•ी เค•ोเคถिเคถ เค•เคฐเคคे เคนै เคœो เค•्เคฐिเคเคŸ เคจเคนीं เค•िเคฏा เค—เคฏा เคนै เคคो เคตเคน variable automatically create เคนो เคœाเคคा เคนै। เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค เคจिเคšे เคฆिเค เคนुเค program เค•ो เคฆेเค–िเคฏे। <?php function myFunction(&$a) { $a = 2; echo $a; } // Passing a without creating it myFunction($a); ?> เคŠเคชเคฐ เคฆिเค เค—เค เค‰เคฆाเคนเคฐเคฃ เคฎें myFunction()เค•ो call เค•เคฐเคคे เคธเคฎเคฏ เคเค• เคเคธा variable pass เค•िเคฏा เคœा เคฐเคนा เคนै เคœिเคธเค•ो เค•्เคฐिเคเคŸ เคนी...