> argument passed by reference ~ Online tutorial

argument passed by reference

By default arguments are passed by value(so that it will changed inside function only not outside the function).So we are going the value then send value by reference,prepend by (&) to the argument name in the function definition.
Syntax
function fun_name(&$varname)
Example

<?php
function my(&$num)
{
$num='welcome';
}
$str="welcome";
my($str);
echo $str;

?>


Output


Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

1 comments:

Unknown said...

This is a really good read for me, www.ycdress.com www.dressesforbest.co.uk Must admit that you are one of the best bloggers I ever saw.