> -Original Message-
> From: Gerald Timothy Quimpo [mailto:[EMAIL PROTECTED]]
> Sent: 02 January 2003 14:12
>
> alternatively, if you don't want to change to array syntax,
> you can use
> variable variables. e.g.,
>
> $variable_name="comment_".nIndex; // now comment_1, for example.
On Wednesday 01 January 2003 01:41 pm, Timothy Hitchens (HiTCHO) wrote:
> Use the count like following inside to ensure that you don't
> call on a non existent index.
>
> for ($i = 0, $x = count($comment); $i < $x; $i++)
> {
> echo $comment[$i].'';
> }
>
> Why do you want to echo out $comment_1
> -Original Message-
> From: Sean Malloy [mailto:[EMAIL PROTECTED]]
> Sent: 02 January 2003 13:35
> To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED]
> Subject: RE: [PHP] makeing an array
>
>
> see example 2.
But that produces the elements in reverse order -- no
see example 2.
> -Original Message-
> From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 1 January 2003 11:00 PM
> To: Sean Malloy; [EMAIL PROTECTED]
> Subject: Re: [PHP] makeing an array
>
>
> Your example of:
>
> for ($i = 0; $i &
ort
- Original Message -
From: "Sean Malloy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 9:40 PM
Subject: RE: [PHP] makeing an array
> why the $x variable aswell?!
>
> for ($i = 0; $i < count($comment); $i++)
> {
> e
TECTED]]
> Sent: Wednesday, 1 January 2003 4:41 PM
> To: Philip J. Newman; [EMAIL PROTECTED]
> Subject: Re: [PHP] makeing an array
>
>
> Use the count like following inside to ensure that you don't
> call on a non existent index.
>
> for ($i = 0, $x = count($comment);
Open Platform Web Development
Consulting - Outsourcing - Training - Support
- Original Message -
From: "Philip J. Newman" <[EMAIL PROTECTED]>
To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 3:29 P
hens (HiTCHO)" <[EMAIL PROTECTED]>
To: "Philip J. Newman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 6:12 PM
Subject: Re: [PHP] makeing an array
> Example of an Array:
>
> $my_first_array = array(1 => 'first', 2 =
Example of an Array:
$my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');
You can now access these like so:
echo $my_first_array[1]; etc etc
of if you had this: $my_first_array = array('first_name' => 'Philip',
'last_name' => 'Newman');
You could do this:
echo $my_first_arra
9 matches
Mail list logo