Re: Variable as an index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$users is an array and you are trying to simply put it in a string. $x seems
to be undefined ergo it's not printing anything. If 'U' is the index in the
array for your variable, use the '.' operator to concatenate strings:

echo "<tr>
   <td width='110' bgcolor='$row_color' nowrap>
  '" . $users[$x]['U'] ."'</td>
   </tr>";

Tim-Hinnerk Heuer

http://www.ihostnz.com


On Mon, Dec 22, 2008 at 10:44 AM, MikeP <mpeloso@xxxxxxxxxxxxx> wrote:

> Hello,
> I am trying to output the value of the following:($x is an int incremented
> by a for statement.
>    echo "<tr>
>    <td width='110' bgcolor='$row_color' nowrap>
>   '$users[$x][U]'</td>
>    </tr>";
>
> I have tried putting the quotes all over and all I get is:
> 'Array[U]'.
>
> What am I doing wrong.
> Thanks
> Mike
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux