Re: [PHP] Problems with Arrays and print and echo

2006-04-09 Thread Michael Felt
John Wells wrote: echo "$this->name[5]\n"; echo "$this->ID[5]\n"; $a1 = $this->name; $a2 = $this->ID; echo "\n$a1[5] $a2[5]\n"; use curly brackets to help PHP understand what you're after: echo "{$this->name[5]}\n"; When you're in a string like this, PHP has a hard time knowing when you're w

Re: [PHP] Problems with Arrays and print and echo

2006-04-08 Thread John Wells
> > echo "$this->name[5]\n"; > > echo "$this->ID[5]\n"; > > $a1 = $this->name; > > $a2 = $this->ID; > > echo "\n$a1[5] $a2[5]\n"; use curly brackets to help PHP understand what you're after: echo "{$this->name[5]}\n"; When you're in a string like this, PHP has a hard time knowing when you're wan

Re: [PHP] Problems with Arrays and print and echo

2006-04-08 Thread Michael Felt
Michael Felt wrote: echo "\n". $this->name[5] . " " . $this->ID[5]. "\n"; This give the same output as: $a1 = $this->name; $a2 = $this->ID; echo "\n$a1[5] $a2[5]\n"; Looks like I may need to use the '.' constructor more often Who can explain this (please)? Michael Felt wrote: OK . a rewri

Re: [PHP] Problems with Arrays and print and echo

2006-04-08 Thread Michael Felt
Michael Felt wrote: OK . a rewrite, bit shorter... 1. A class construct with two arrays: var $name; var $ID; function init($id) { $this->name = array(); $this->ID = array(); # firther in code assignment done from a mysql database: while ($max--)

Re: [PHP] Problems with Arrays and print and echo

2006-04-08 Thread Michael Felt
chris smith wrote: On 4/7/06, Michael Felt <[EMAIL PROTECTED]> wrote: Slowly I am getting the output I want. Trying to use "dynamic" arrays, does creat the array I want, but getting the info is sometimes surprising. I notice a difference between arrays used locally in a function, and arrays u

Re: [PHP] Problems with Arrays and print and echo

2006-04-08 Thread chris smith
On 4/7/06, Michael Felt <[EMAIL PROTECTED]> wrote: > Slowly I am getting the output I want. > > Trying to use "dynamic" arrays, does creat the array I want, but getting > the info is sometimes surprising. > > I notice a difference between arrays used locally in a function, and > arrays used as a 'v

RE: [PHP] Problems with arrays

2004-06-17 Thread Ford, Mike [LSS]
On 17 June 2004 14:27, Phpu wrote: > Here is the code: > > onchange="model_jump('parent', this)"> > > foreach ($nav_model_names as $index => $element) { > $InputString = "$element"; > echo "$InputString"; >} > > > Each option needs to be in, er,

Re: [PHP] Problems with arrays

2004-06-17 Thread Daniel Clark
echo "$InputString" . ''; // for HTML echo "$InputString\n"; // for output to screen >>Hi, >> >>I have this array: >> >>$array = array(element1, element2, element3, element4) >> >>I want to list all elements of this array, so i used: >> >> foreach ($array as $index => $eleme

Re: [PHP] Problems with arrays

2004-06-17 Thread Steve Douville
"Phpu" <[EMAIL PROTECTED]> To: "Steve Douville" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 9:26 AM Subject: Re: [PHP] Problems with arrays > Here is the code: > > > > foreach ($nav_model_names

Re: [PHP] Problems with arrays

2004-06-17 Thread Phpu
; Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 4:23 PM Subject: Re: [PHP] Problems with arrays > Can you give us the code from to ? > - Original Message - > From: "Phpu" <[EMAIL PROTECTED]> > To: "Steve Douville" <[EMAIL PROTECTED]

Re: [PHP] Problems with arrays

2004-06-17 Thread Steve Douville
Can you give us the code from to ? - Original Message - From: "Phpu" <[EMAIL PROTECTED]> To: "Steve Douville" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 9:14 AM Subject: Re: [PHP] Problems with arrays > I want the

Re: [PHP] Problems with arrays

2004-06-17 Thread Phpu
I want the element of the array to be displayed in a field - Original Message - From: "Steve Douville" <[EMAIL PROTECTED]> To: "Phpu" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 4:12 PM Subject: Re: [PHP] Problems w

Re: [PHP] Problems with arrays

2004-06-17 Thread Steve Douville
What are you outputting? html, text, email body...?? - Original Message - From: "Phpu" <[EMAIL PROTECTED]> To: "Oliver Hankeln" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 9:06 AM Subject: Re: [PHP] Problems with ar

Re: [PHP] Problems with arrays

2004-06-17 Thread Phpu
I've tried this but it is not working ... Thanks anyway - Original Message - From: "Oliver Hankeln" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 4:04 PM Subject: Re: [PHP] Problems with arrays > Phpu wrote: >

Re: [PHP] Problems with arrays

2004-06-17 Thread Oliver Hankeln
Phpu wrote: Hi, I have this array: $array = array(element1, element2, element3, element4) I want to list all elements of this array, so i used: foreach ($array as $index => $element) { $InputString = "$element"; echo "$InputString"; } but this code lists the elements l