Re: [PHP] Shipping Rates

2003-06-04 Thread Jaap van Ganswijk
At 2003-06-01 01:48 -0700, Ralph wrote: >Maybe it's just that it's late, but can't seem to figure this out. I >want to show a shipping price depending on the amount of purchase. I >thought about using a lot of if() statements, but I know this is not the >best way to go about this. > >Can anybody en

RE: [PHP] Shipping Rates

2003-06-03 Thread Ford, Mike [LSS]
> -Original Message- > From: Jim Lucas [mailto:[EMAIL PROTECTED] > Sent: 02 June 2003 18:07 > To: Jim Lucas; Rasmus Lerdorf; Ralph > > Answering my own answer. I see now how you are extracting > the sub array > information. > > My mistake. Notwithstanding that, I think your question wa

Re: [PHP] Shipping Rates

2003-06-03 Thread Jim Lucas
Cc: "PHP General Mailing List" <[EMAIL PROTECTED]> Sent: Monday, June 02, 2003 9:57 AM Subject: Re: [PHP] Shipping Rates > is this correct? > > wouldn't you want the array to be like this? > > $rates = array('7.45'=>20, >

Re: [PHP] Shipping Rates

2003-06-03 Thread Jim Lucas
) continue; else { $price = key( $rates[$i] ); break; } } Correct me if I am wrong. Jim Lucas - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Ralph" <[EMAIL PROTECTED]> Cc: "PHP General Mailing List" <[EMAI

Re: [PHP] Shipping Rates

2003-06-01 Thread Rasmus Lerdorf
Better approach in what sense? From a performance perspective you are not going to beat a specific set of if conditions unless there is an distinct formula you can apply. I will assume there is no simple mathematical relationship for your full set of data and what you are really looking for is a

RE: [PHP] Shipping Rates

2003-06-01 Thread Ralph
I thought about this but how would I go about performing greater than or equal to without having to specify a CASE for every price range? -Original Message- From: Jason Paschal [mailto:[EMAIL PROTECTED] Sent: Sunday, June 01, 2003 1:47 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Shipping