Re: [PHP] Re: how to build an array

2002-02-22 Thread jtjohnston

Yeah but, this doesn't work either? I'm trying :)

 $news = mysql_query("select AS from $table");

 while ($mydata = mysql_fetch_object($news))
 {
# $authors = explode(";", $mydata->AS);
 array_push ($authors, explode(";", $mydata->AS));
 }

 foreach($authors as $author)
 {
 echo "$author\n";
 }



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




Re: [PHP] Re: how to build an array

2002-02-22 Thread Steven Walker

Also, for adding items onto an array use array_push()

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 22, 2002, at 07:41  PM, Jim Winstead wrote:

> Jtjohnston <[EMAIL PROTECTED]> wrote:
>> Where/How do I start in building a new array? ".=" doesn't work:
>>
>> $authors .= explode(";", $mydata->KW);
>
> '.=' doesn't work because that does a string append.
>
> you just want:
>
>   $authors = explode(";", $mydata->KW);
>
> then you can sort the array using sort(). http://php.net/sort
>
> jim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] Re: how to build an array

2002-02-22 Thread Jim Winstead

Jtjohnston <[EMAIL PROTECTED]> wrote:
> Where/How do I start in building a new array? ".=" doesn't work:
> 
> $authors .= explode(";", $mydata->KW);

'.=' doesn't work because that does a string append.

you just want:

  $authors = explode(";", $mydata->KW);

then you can sort the array using sort(). http://php.net/sort

jim

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