RE: [PHP] changing array to a string
| From: | Peter Lauri | Date: | Wed, 28 Mar 2007 05:49:03 +0000 |
| Subject: | RE: [PHP] changing array to a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251506@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Richard Kurth [mailto:richardkurth@centurytel.net]
> Sent: Wednesday, March 28, 2007 6:12 AM
> To: php-general@lists.php.net
> Subject: [PHP] changing array to a string
>
> When I submit the for below it gives me an array that looks like this
> "array(5) { [0]=> string(1) "3" [1]=> string(1) "4" [2]=>
> string(1) "5"
> [3]=> string(1) "6" [4]=> string(1) "7" } "
> I would like to convert it to a string like this "3,4,5,6,7"
>
>
> <form action="test.php" method="post">
> <table>
> <tr><td colspan="2" align="left"><input
> name="subscriptions[]" value="3"
> type="checkbox">test message
> </td></tr><tr><td colspan="2"
> align="left"><input name="subscriptions[]"
> value="4" type="checkbox">test message
> </td></tr><tr><td colspan="2"
> align="left"><input name="subscriptions[]"
> value="5" type="checkbox">test message
> </td></tr><tr><td colspan="2"
> align="left"><input name="subscriptions[]"
> value="6" type="checkbox">test message
> </td></tr><tr><td colspan="2"
> align="left"><input name="subscriptions[]"
> value="7" type="checkbox">test message
> </td></tr>
> </table>
> <input type="hidden" name="doit" value="yes">
> <input type="submit" name="submit">
>
> </form>
[Peter Lauri - DWS Asia]
Check www.php.net/implode
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free