Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Php references in hindi
1. You can download this document from www.besthinditutorials.com
PHP references
, इस tutorial PHP references References
स values assign स , pass स औ return
स References स suggest
variables औ functions इस PHP in Hindi :
Variables औ PHP in Hindi : Functions स
Outline
Introduction to PHP references in Hindi
Assigning values using PHP references in Hindi
Passing values using PHP references in Hindi
Returning values using PHP references in Hindi
Introduction to PHP references
PHP references value अ अ स access
pointers program
Example – References
<?php
$a =& $b;
$a = "Indian";
echo $a; // will print Indian
echo $b; // it will also print Indian
?>
2. You can download this document from www.besthinditutorials.com
program variables value print same
value print value refer
स स variable assign, pass औ return
व variable automatically create
program
Example – References
<?php
function myFunction(&$a)
{
$a=2;
echo $a;
}
myFunction($a);
?>
myFunction() call स स variable pass
स function इस
variable reference स इस PHP इस variable
automatically
for each referenced variables variables
value update program
Example – References (for each loop)
<?php
$arr = array(1,2,3,4,5);
$number =& $value;
foreach($arr as $value)
{
echo $value;
}
echo $number;
3. You can download this document from www.besthinditutorials.com
echo $value;
?>
foreach $value variable इस
स स $number variable array value update औ
variables iteration last value 5 print
Assigning by reference
variable स variable value assign simple इस
ampersand(&) operator इस reference व assign
स
Ex.
$a =& $b
स PHP reference
variables same value point References स
अ इ स स variable value
assign स value point
4. You can download this document from www.besthinditutorials.com
Passing by reference
references व variable स स reference स
स स function parameters ampersand (&) स declare
स स स parameter function
स औ स tasks perform स स स parameter change
argument update program
Example – Passing by reference
<?php
function myFunction(&$num)
{
$num=$num*2; // $num can be used as $a.
}
$a = 5;
myFunction($a);
echo $a; // prints 10
?>
$a reference स औ function $num
$num value change $a value change
औ 10
Returning reference
स function स reference return function स
ampersand (&) operator
5. You can download this document from www.besthinditutorials.com
Example – Returning references
<?php
class myClass {
public $name = "jai";
public function &myFunction() //returns reference of $name
{
return $this->name;
}
}
$obj = new myClass;
$myname = &$obj->myFunction(); // assigning by reference to $myName
echo $myname; // prints jai
$obj->name = "jai ho";
echo $myname; // prints jai ho
?>
इस स function reference return स स
variable assign
Read more tutorials on PHP in Hindi at www.besthinditutorials.com