Re: Ok, I know this may sound like a stupid question...

From: Date: Tue, 05 Dec 2000 22:45:06 +0000
Subject: Re: Ok, I know this may sound like a stupid question...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28766@lists.php.net to get a copy of this message
Im going against what you were asking because its alot easier with arrays. <? $this = 13; $that = 9; $other = 27; $bob = 2; $tmp['this'] = $this; $tmp['that'] = $that; $tmp['other'] = $other; $tmp['bob'] = $bob; asort($tmp); foreach($tmp as $pos => $val) echo "$pos : " . $$pos . "<br>\n"; ?> This should work. Chris Lee Mediawaveonline.com In article <4040BBE81A9AD411BD27009027887A7C0428BE@tiger.wild.net>, "Boget, Chris" <Chris.Boget@wild.net> wrote: > but I've been trying to find *simple* logic to do this and I cannot > seem to wrap my head around it... > > I have 4 variables that are dynamically assigned numerical values. > Let's say, after all the dynamic assignement is completed, I end up > with: > > $this = 13; > $that = 9; > $other = 27; > $bob = 2; > > What is the simplest way to figure out what order those variables should > go in ascending order.... Without putting the above 4 variables in an > array... > > I've got some code, but it's soooo long. Longer than it should be, I'm > sure. > > Thanks for any help you can provide! > > Chris

« previous php.general (#28766) next »