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 laracast?

810


Tell me what is the use of explode() function?

748


Explain the differences between get and post methods?

750


What is php session start?

757


How to process the uploaded files?

825


Is php still in demand?

772


Tell me how to strip whitespace (or other characters) from the beginning and end of a string?

738


Which php framework is in demand?

655


What is the difference between pop3 IMAP and MAPI?

853


What is php and how do you use it?

760


How to support multiple-page forms?

776


Why php is used?

851


What is difference between require_once(), require(), include()?

717


How can you increase the maximum execution time of a script in php?

745


What is difference between mysql_connect and mysqli_connect?

721