answersLogoWhite

0

// While this doesn't prompt the user for input, it does reverse the values' contents. $intA = '10';

$intB = '20';

$tmp = $intA;

$intB = $intA;

$intA = $tmp;

print $intA; // 20

print $intB; // 10 // An even quicker way is...

list($b,$a) = array($a,$b);

User Avatar

Wiki User

17y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin

Add your answer:

Earn +20 pts
Q: Write a program that asks the user to type two integers A and B and exchange the value of A and B?
Write your answer...
Submit
Still have questions?
magnify glass
imp