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 / sunil kumar
<?php
$a = 10;
$b = 20;
echo $a, $b;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;
echo "<br>";
echo $a, $b;
?>
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
How to set cookies in PHP?
What kind of things have you done on the social side?
What is php session_start() and session_destroy() function?
Differences between get, post and request methods ?
What is move_uploaded_file in php?
Is php an api?
What are advantages of .htaccess?
What are psrs?
Is not null in php?
Does php support overloading?
Which is the best web server?
What are the two types of variables?
Explain scalar type declarations in php7?
What are the common uses of php?
What are the functions for imap?