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 / sangita jain
<?php function swap(){
$a=10;
$b=20;
$b=$b-$a;
$a=$a+$b;
echo $a,$b;
}
swap();
?>
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
How long will it take to learn php?
What is the difference between core php and php?
What is the use of dual table in mysql?
What is the use of the function 'imagetypes()'?
What are constructor and destructor in PHP?
How many escape sequences are recognized in double-quoted strings?
What is the definition of a session?
What is the php function that removes the last element of the array and returns it?
How to convert a string to lowercase in php?
What is cookie in php with example?
Can you convert php to html?
What is different types of visibility?
Who created numbers?
what is the scope of php in the future if any other language is developed then may be php is loss ???
Difference between array_combine and array_merge?