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

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

2084


design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

17662


differences between qtp10.0 and 11.0 ?

2233


Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad

2263


1.Mutating table

1824


iam confused to choose among testing, .net and java can anybody help me????????

2051


When will you use shell script/Perl ahead of C/C++?

1058


How will you prove that java swing is multithreaded?

2257


what is the similarity between networking devices?

2167


what is apt_dump_score in datastage where it is useful

1924


In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..

1434


My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?

1914


Explain with examples any 2 features of OOPS.

1092


what is web configuration file

2026


Write a pascal program to calculate the sum of the first 100 even number and odd number

4358