[thelist] PHP String Indexed Arrays

John Corry webshot at members.evolt.org
Fri Jun 7 09:43:14 CDT 2002


I'm from the 'if it works, it's elegant enough' school of programming.

Progress, not perfection.

Why don't you...

A) output each item in the array + a trailing \ (or /...whatever) to a
string variable, $output

B) use $output = substr($output, 0, -1) to return everything except the
last character (which would be the offending, unnecessary \ (or
/...whatever). http://www.php.net/manual/en/function.substr.php

Yes, it's innefficient...but it works.

I guess my real point is that there is always more than one way to get
to the 'right' answer.

Hth,
John Corry




More information about the thelist mailing list