Re: Ok, I know this may sound like a stupid question...
| From: | Hardy Merrill | Date: | Wed, 06 Dec 2000 15:04:20 +0000 |
| Subject: | Re: Ok, I know this may sound like a stupid question... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28917@lists.php.net to get a copy of this message | ||
I'm fairly new to PHP, but looks to me like the only built-in
sort functions sort arrays. I'd put your variables into an
array and use "asort" or one of the other sort functions on
the array.
HTH.
---
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
Joe Smargie [joes@th.net] wrote:
>
> Order is sort of a misnomer. Three variables like that don't really have
> an order. They're just three things. Only in the context of an array do
> things (the elements of said array) have an order.
>
> -Joe S.
> [------------------------------------------------]
> Joe Smargie <joes@th.net>
> Systems Administrator - Technology Horizons
>
> 1-413-253-7700 (888-762-2283)
> [------------------------------------------------]
>
> This message is intended to be confidential and may be legally privileged.
> It is intended solely for the addressee. Unless authorized, any disclosure,
> copying, distribution or action taken or omitted in reliance on this message
> is prohibited and may be unlawful.
>
> ----- Original Message -----
> From: "Boget, Chris" <Chris.Boget@wild.net>
> To: "PHP (E-mail)" <php-general@lists.php.net>
> Sent: Tuesday, December 05, 2000 1:11 PM
> Subject: [PHP] Ok, I know this may sound like a stupid question...
>
>
> > 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
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net