Re: Variable as an index
| From: | German Geek | Date: | Sun, 21 Dec 2008 22:02:48 +0000 |
| Subject: | Re: Variable as an index | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284937@lists.php.net to get a copy of this message | ||
$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@princeton.edu> 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
>
>