How to swap values between two variables without using a
third variable?
Answer Posted / sriram
Hey guys, what about swaping variables contains string
values? All of your solutions will suck... Try this and swap
any datatype without third variable... Happy Sensible Coding..
$v = 'sriram';
$u = 'lakshmi';
$v .= $u;
$u = substr($v,0,(strlen($v) - strlen($u)));
$v = substr($v,(strlen($v) - strlen($u)-1), strlen($v));
echo 'u = ' . $u .'<br>';
echo 'v = ' . $v;
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
how to add a new table with variables and thier values into a imported file uisng proc import?
what is the current salary package in India for a lamp programmer
1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?
Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.
Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.
Do not use more than 3 nested IF. Use Evaluate statement in case of more IF required. Please give a detail explantion besides readability and clarity for Evaluate stmt.
Tell me the jobs for the MCA Fresher in delhi, Noida..
what do u mean by tagging
What is WEB 3.0? What are the features their in WEB3.0
what is throws keyword
Delta 5 weight scale not connect with oracle application what i can do?
Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.
what is difference between object oriented programming structure and object oriented programming system?
how many types of bytes are there???
Hello Experts, What is the difference between move and move corresponding exactly? please post me asap