[PHP] echo only displays first character

2001-03-16 Thread Tom Harris
Here's an interesting problem. The following only prints the first letter of the name for ($i=0; isset($empid[$i]); $i++) { echo "$empid[$i] $name[$i]"; } But if I change the variable $name to $employeename throughout the script it displays fine. $empid[] and $name[] are both assigned ea

Re: [PHP] echo only displays first character

2001-03-16 Thread Chris Lee
please post more code, ie where $name is set. in the mean time try this, shouldnt help but might foreach($empid as $pos => $val) { echo "{$empid[$pos]} {$name[$pos]}"; } -- Chris Lee [EMAIL PROTECTED] ""Tom Harris"" <[EMAIL PROTECTED]> wrote in message 98tcfg$bn3$[EMAIL PROTECTED]">

RE: [PHP] echo only displays first character

2001-03-16 Thread Mal McKay
Are you sure $name is an array. t appears to be a string and the $name[$i] references one character in that string mal -Original Message- From: Tom Harris [mailto:[EMAIL PROTECTED]] Sent: 16 March 2001 15:50 To: [EMAIL PROTECTED] Subject: [PHP] echo only displays first character