Desires and elegant foreach for a messy array - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Desires and elegant foreach for a messy array (/showthread.php?tid=48963) |
Desires and elegant foreach for a messy array - El Forum - 02-02-2012 [eluser]pdxbenjamin[/eluser] My array looks something like this... Code: Array When I foreach through them I get... Code: 1 That isn't my problem, what I have is an update running at the end of each iteration. Code: 1 How do I make it a collective so I can format the string, and make one Update. I'd like to have the final result. 1, 2, 3, 4, 5 Thanks. Desires and elegant foreach for a messy array - El Forum - 02-02-2012 [eluser]jmadsen[/eluser] assuming you want to build an sql IN clause? Look at http://php.net/manual/en/function.implode.php Desires and elegant foreach for a messy array - El Forum - 02-02-2012 [eluser]pdxbenjamin[/eluser] Yes, thank you that's what I needed. |