Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP implode?
October 4, 2008, 5:15 am
rate this thread
I'm not quite sure which function to use when I want to add a comma to
the end of every line and a semi colon to the last one. Because it
generates everything on the fly I can't count the rows from a db.
Here's what I want to do:
orange; <--Last one so semi colon
Any help is greatly appreciated
Re: PHP implode?
Why can't you count the rows? I need a little more info, but assuming
you have all the lines in an array; from the example given for implode()
in the manual:
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);