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
How many records can be stored in mysql table?
What is difference between readonly and constant?
Is php faster than nodejs?
How do I sort numbers in php?
How long should a session last?
Whether php supports microsoft sql server?
How to generate a character from an ascii value?
How escape single quotes php?
what is variable scope, which variables are accessible from where and what are "undefined variable" errors?
Explain setcookie() function in php?
Tell me what is the difference between unset() and unlink()?
What is smarty?
What does it mean when it says the csrf token is invalid?
What is cookie and session in php?
Are php variables global?