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 / ajay
I checked the answer posted by Sunil. This answer is
correct,the only mistake he did that the program print the
output together as 1020,2010,not like this
10
20
20
10
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Explain the difference between isset() and empty()?
How to send email using php script?
How can we increase execution time of a php script?
What is cookie in php with example?
What is var_dump function in php?
What is meant by PEAR in PHP?
What is the difference between apache and tomcat?
What is the use of htmlentities in php?
What are the features and advantages of object-oriented programming in php?
Explain the different types of errors in php.
How to concatenate two strings in php?
Tell me how comparison of objects is done in php5?
Swap two variables value without using third variable in php ?
How to randomly retrieve a value from an array?
How to remove an empty directory?