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
What is if isset ($_ post submit )) in php?
What is difference between session_unset and session_destroy?
Explain what is the function file_get_contents() usefull for?
Why print_r is used in php?
What is super keyword in c++?
Are sessions stateless?
Does php have future?
Does cors prevent csrf?
What is php7?
What is php written in?
How to open a file for reading?
where do we use htaccess?
Does wordpress run on php 7?
What is the function in PHP do not return a timestamp?
What is a session in php?