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) {
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:
http://www.nabble.com/foreach-loop-to-set
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 wit
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 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 ($f
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 comm
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
> Se
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'),ar
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
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 i
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]
-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($mu
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, Larr
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
argu
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] foreac
> >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
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) {
>
We would blame Mac/Apple
- Original Message -
From: PHPBeginner.com <[EMAIL PROTECTED]>
To: John Meyer <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 3:10 AM
Subject: RE: [PHP] foreach loop
>
>
> >If we didn't have Microsoft, we
>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 c
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
a
20 matches
Mail list logo