Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how to add a new table with variables and thier values into a imported file uisng proc import?

1951


what is the current salary package in India for a lamp programmer

2379


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?

2270


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.

1169


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.

2541


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.

2034


Tell me the jobs for the MCA Fresher in delhi, Noida..

2449


what do u mean by tagging

2109


What is WEB 3.0? What are the features their in WEB3.0

2222


what is throws keyword

3758


Delta 5 weight scale not connect with oracle application what i can do?

2380


Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.

1144


what is difference between object oriented programming structure and object oriented programming system?

1993


how many types of bytes are there???

2621


Hello Experts, What is the difference between move and move corresponding exactly? please post me asap

1932