On Sun, 6 Jul 2003, arnaud gonzales wrote:

> Hi all,
> I am getting crazy, can't understand what i missed!
> Does anybody know?
> 
> $champs = array ("titre_art" => "h3" ,"nom" => "bleu", 
>                  "prenom" => "green", "resume" => "bold");
> 
> foreach($champs as $key => $value) {
>     echo "<td class='$value'>$row($key))</td>";
> }

It works fine, you are using different code then the above.
In your actual code, make sure you pass in an array that
exists, as currently you are not.

One example reason, the foreach is inside a function and
$champs isn't available in the functions scope (global).

At any rate, before your foreach, var_dump($champs) and
it'll let you know what is up.

Regards,
Philip

p.s. In case $row is an array, you actually mean to write
it as $row[$key], but this is unrelated to the error that
foreach is providing.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to