Re: [PHP] foreach loop to set variables

2008-04-25 Thread Stut
On 25 Apr 2008, at 14:12, jamest wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success. foreach

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Jason Norwood-Young
On Fri, 2008-04-25 at 06:12 -0700, jamest wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success.

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Casey
On Apr 25, 2008, at 6:12 AM, jamest [EMAIL PROTECTED] wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with

Re: [PHP] foreach loop to set variables

2008-04-25 Thread jamest
Thats perfect. I didn't even know about this. Stut wrote: $$key = $value; They're called variable variables - search the manual for that term for more info. -Stut -- http://stut.net/ -- View this message in context:

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Jim Lucas
jamest wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success. foreach ($formdata as $key = $value) {

RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-24 Thread Larry Brown
Yes, tested and verified. It was the accelerator. They have multiple binaries, one for each version of PHP. Matching the new binary to the new version of PHP solved this problem. Thanks again. Larry On Tue, 2005-08-23 at 20:35, Larry Brown wrote: Sorry, that last one went out without a

RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Ford, Mike
-Original Message- From: Larry Brown To: php Sent: 23/08/05 02:28 Subject: [PHP] foreach loop changed after 4.3 - 4.4 upgrade I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through

Re: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Edward Vermillion
Larry Brown wrote: I found that the only way to get the function to behave is to add the key... foreach($multiarray as $key=$subArray) Now it displays as it previously did where $subArray is concerned. Is there something I'm missing here? Was I the only person not using keys? [snip]

Re: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Evert | Rooftop
I switched from 4.3 to 4.4 on a server with a huge web application using both foreach loops with and without the keys.. No problem whatsoever.. Evert Larry Brown wrote: I found that the only way to get the function to behave is to add the key... foreach($multiarray as $key=$subArray) Now

Re: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Pinter Tibor (tibyke)
turck-mmcache? t Edward Vermillion wrote: Larry Brown wrote: I found that the only way to get the function to behave is to add the key... foreach($multiarray as $key=$subArray) Now it displays as it previously did where $subArray is concerned. Is there something I'm missing here? Was I

RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Larry Brown
On Tue, 2005-08-23 at 05:30, Ford, Mike wrote: -Original Message- From: Larry Brown To: php Sent: 23/08/05 02:28 Subject: [PHP] foreach loop changed after 4.3 - 4.4 upgrade I had a foreach loop working on an array as such: $multiarray =

RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-23 Thread Larry Brown
Sorry, that last one went out without a comment. I think this is most likely the cause. I haven't dug back into it yet to verify, but it makes the most sense. Thanks everyone... Larry On Tue, 2005-08-23 at 05:30, Ford, Mike wrote: -Original Message- From: Larry Brown To: php Sent:

Re: [PHP] foreach loop changed after 4.3 - 4.4 upgrade

2005-08-22 Thread Larry Brown
I found that the only way to get the function to behave is to add the key... foreach($multiarray as $key=$subArray) Now it displays as it previously did where $subArray is concerned. Is there something I'm missing here? Was I the only person not using keys? On Mon, 2005-08-22 at 21:28, Larry

Re: [PHP] Foreach loop with empty values

2003-06-13 Thread CDitty
Got it fixed. Never mind. Thanks At 10:49 PM 6/13/2003, CDitty wrote: I have a foreach loop in a while loop that retrieves information from my database. The foreach loop works fine if there is data in the database for that loop. But if nothing is found in the database, I get a Invalid

RE: [PHP] foreach loop

2001-07-07 Thread PHPBeginner.com
actually the logic is follow: every array has a key, therefore, you use: foreach($variables as $key = $value) { $variables[$key] = strip_tags($value); $variables[$key] = AddSlashes($value); } where you get an array element with whatever key it uses, work on it's value

RE: [PHP] foreach loop

2001-07-07 Thread PHPBeginner.com
If we didn't have Microsoft, we'd have to blame ourselves for all of our programs crashing I really don't think so :-) -maxim maletsky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To

Re: [PHP] foreach loop

2001-07-07 Thread Steve Edberg
At 10:31 AM -0700 7/7/01, John Meyer wrote: When I go through a foreach loop, are the values of the individual items in the array changed? For instance: $variables = array($author_firstname, $author_lastname, $author_dob, $author_dod, $author_bio); foreach($variables as $value) {

RE: [PHP] foreach loop

2001-07-07 Thread John Monfort
If we didn't have Microsoft, we'd have to blame ourselves for all of our programs crashing If we didn't have microsoft, 'Crashing Programs' wouldn't be part of our daily vocabulary :) __John Monfort_ _+---+_ P E P I E D E S I

Re: [PHP] foreach loop

2001-07-07 Thread Chris Anderson
Good call - Original Message - From: John Monfort [EMAIL PROTECTED] To: PHPBeginner.com [EMAIL PROTECTED] Cc: John Meyer [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, July 07, 2001 6:27 PM Subject: RE: [PHP] foreach loop If we didn't have Microsoft, we'd have to blame