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) {
echo $key
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
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.
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
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:
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) {
] 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
foreach($multiarray as $subArray){
do something with array
}
on each
-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
foreach
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]
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
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
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 = array(array('person','person'),array
: 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
foreach($multiarray as $subArray){
do something with array
I had a foreach loop working on an array as such:
$multiarray = array(array('person','person'),array('another','another'))
the array was put through
foreach($multiarray as $subArray){
do something with array
}
on each loop I would see $subArray= array([0] = 'person',[1] = 'person')
and then
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
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
argument supplied error.
Can anyone suggest a fix for this? The foreach
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
Ok, I asked a similar question more than a year ago, so I apologize for
being a little redundant :)
Why was PHP's foreach loop syntax chosen to be
foreach($dogs as $dog){}
instead of something more common (Python, Javascript, can't think what else
right now) and, to me, more intuitive, like
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) {
$value = strip_tags($value);
$value =
08, 2001 2:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] foreach loop
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
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
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) {
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
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
24 matches
Mail list logo