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


Please Help Members By Posting Answers For Below Questions

Which is used to maintain the value of a variable over different pages?

564


What is polymorphism in oop php?

504


Explain what is the difference between for and foreach?

524


What is meant by session in php?

498


Is strcmp case sensitive?

510






What is the difference between $name and $$name?

523


What is a php certification?

493


How to support multiple-page forms?

561


What does odbc do in context with php?

569


What are the characteristics of php variables?

517


What is a namespace in php?

473


Tell me how is it possible to return a value from a function?

546


How come the code works, but does not for two-dimensional array of mine?

497


Write a statement to show the joining of multiple comparisons in php?

532


How many ways to include array elements in double-quoted strings using php?

556