On Wednesday, March 27, 2002, at 04:11  PM, Matt Friedman wrote:

> When you have all your items in an array use implode to add a character
> in between every item.
>
> $str = implode($yourArray, $separator);
>
> This will add the separator to the end of each string except the last
> one.

I like that idea, but I don't think it would work in this case -- for 
one thing, the array is a pointer to a mysql_fetch_assoc() result, so I 
am not sure how to implode that (not saying it can't be done), and for 
another, I would have to explode the array again and would lose the 
separator.

Unless... unless I were to implode with say, a bogus separator AND a 
'real' separator, and then explode using only the bogus separator 
(leaving the 'real' separator hanging onto the end of each element).

This seems like it could work, but in a complex array like a 
mysql_fetch_assoc() result, I'm not sure how to implode.


Erik




----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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

Reply via email to