Simple PHP problem...help needed.

Entity

Lifer
Oct 11, 1999
10,090
0
0
I'm using a program called DadaBik (great program) for manipulating mysql database entries through a form-style processor. One of the things it does it, when generating checkboxes, enters the string like this:

$checkboxentry = "~Calculation of descriptive statistics~Data analysis~Study design~Manuscript preparation~"

Note the tilde at the beginning and end. This is a requirement for dadabik, otherwise, the checkbox will show up with the first letter of the first option and last letter of the last option missing. Anyway...

I'm using explode and implode to try to convert a string like that into something that looks a bit nicer when printed in a HTML format...like this:

Calculation of descriptive statistics, Data analysis, Study design, Manuscript preparation

I've been doing that with this set of commands:

$dutylist = explode("~", $duties);
$dutyprint = implode(", ", $dutylist);

It works rather well, but the output isn't exactly what I want. It shows up like this:

, Calculation of descriptive statistics, Data analysis, Study design, Manuscript preparation,

How can I get it to format the string so it begins with calculation (essentially, I want it to delete the entries $dutylist[0] and $dutylist[last] before imploding $dutylist into $dutyprint.

Any help would be appreciated. I'm new to PHP, but can't figure this out from my books, etc. :p

Rob