On Tue, 2004-02-17 at 13:01, John Taylor-Johnston wrote:
> $tempauthors = explode("\r\n", $mydata->AuthorList);
> foreach ($tempauthors as $singleauthor)
> # while($tempauthors = each($singleauthor))
> {
> echo "<a href=\"http://www.foo.org$singleauthor\">$singleauthor</a> ";
> }
First of all, you are flipping your variables:
while ($singleauthor = each($tempauthors))
Secondly, check the manual to see what each() returns[1]. It returns an
array with the key and value of the result in it. If you want to use
each() then you need to evaluate $singleauthor as $singleauthor[0] or
$singleauthor['value'] to get its value. Another way to do this that
would be closer to what foreach does would be:
while (list($key, $singleauthor) = each($tempauthors))
This will assign the key to $key and the value you are looking for to
$singleauthor.
[1] http://www.php.net/each
--
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php