1. Write a function to swap two values ?
$a = 10;
$b = 20;
echo $a, $b;
swap(); // If u want u can pass parameters
echo $a, $b; // It should print 20 , 10

Answer Posted / ramse

yes we can do this also.
But pass by reference allow in PHP5 not in PHP4.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is htaccess? Why do we use this and where?

717


How to pass variables and data from php to javascript?

732


Is apache needed for php?

681


What are php data types?

713


Is it more secure to use cookies to trfer session ids?

724


What is var_dump function in php?

771


Can I write php code in html file?

723


What is the tags in PHP is not a valid way to begin and end a PHP code block?

1010


Which database is best for php?

751


What is list in PHP?

842


Is session a cookie?

740


How cookies are transported from browsers to servers?

705


Where sessions stored in PHP?

735


What is the difference between print() and echo()?

799


Where are php configuration settings stored?

732