Re: [PHP] Implode a 2D Array

2009-07-02 Thread Shawn McKenzie
salmarayan wrote: > Can any one tell me how can i implode a two D Array. > i can implode normal arrays, but when i try to implode multidimensional > Arrays, the result is empty. > can some one tell me how to implode an array Like This > > > $x=array ( [0] => array ( [side] => sell [stock_code] =>

Re: [PHP] implode()

2008-11-18 Thread Jim Lucas
Terion Miller wrote: > I have read the whole forum at php.net on implode and I still don't get why > this one does not work > > if (isset($_POST['BannerSize'])){$BannerSize = > implode($_POST['BannerSize'],',');} else {$BannerSize = "";} > > someone please help > Including the error that is gen

Re: [PHP] implode()

2008-11-18 Thread Dan Shirah
On 11/18/08, Terion Miller <[EMAIL PROTECTED]> wrote: > > I have read the whole forum at php.net on implode and I still don't get > why > this one does not work > > if (isset($_POST['BannerSize'])){$BannerSize = > implode($_POST['BannerSize'],',');} else {$BannerSize = "";} > > someone please help

Re: [PHP] implode()

2008-11-18 Thread Craige Leeder
Can we see the form, please? As well, try using print_r on the array and see what it outputs. - Craige Terion Miller wrote: yes there is , the selections are coming from a form (which isn't working because its not inserting into the db---ah another post later I imagine) do you think a mis use

Re: [PHP] implode()

2008-11-18 Thread Craige Leeder
Terion Miller wrote: I have read the whole forum at php.net on implode and I still don't get why this one does not work if (isset($_POST['BannerSize'])){$BannerSize = implode($_POST['BannerSize'],',');} else {$BannerSize = "";} someone please help Is $_POST['BannerSize'] an array? e.g. IS

Re: [PHP] implode()

2008-11-18 Thread Greg Bowser
$BannerSize = implode($_POST['BannerSize'], ','); Looks like you have your arguments backwards; try: $BannerSize = implode(',',$_POST['BannerSize']); --Greg

Re: [PHP] implode()

2008-11-18 Thread Yeti
with implode one can reverse the function arguments i know .. but -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Implode? Explode?

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 5:32 am, Jack Jackson said: > I'm trying to fetch similar things - in this case, rows which share a > series ID no - and bring them into an array and display them grouped by > what makes them similar (in this case, series id). I looked at implode > and explode which seem wron

Re: [PHP] Implode? Explode?

2005-06-06 Thread Jack Jackson
Brent Baisley wrote: You're close, but you need to group your data on the series_id first. You can do that by looping through your array and creating another array using series_id as the array key. You'll end up with a list of arrays named after the series_id. foreach( $result_set as $resul

Re: [PHP] Implode? Explode?

2005-06-06 Thread Brent Baisley
You're close, but you need to group your data on the series_id first. You can do that by looping through your array and creating another array using series_id as the array key. You'll end up with a list of arrays named after the series_id. foreach( $result_set as $result_item ) { //Add

Re: [PHP] implode errors if array empty

2004-09-22 Thread John Holmes
From: "Marek Kilimajer" <[EMAIL PROTECTED]> [EMAIL PROTECTED] wrote: resolved with if(empty()) - apologies. isset() is more apropriate as $enterprise is not defined at all, empty() will issue a notice. No it won't. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] implode errors if array empty

2004-09-22 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote: resolved with if(empty()) - apologies. isset() is more apropriate as $enterprise is not defined at all, empty() will issue a notice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] implode errors if array empty

2004-09-22 Thread Petar Nedyalkov
Hello, I suppose the $enterprise variable doesn't hold an empty array but is not defined and because of this you get the error. Test with the following example: It does not send any errors back. If you substitute $array = array(); with $array = ""; you'll get a woarning: "Warning: implode():

Re: [PHP] implode errors if array empty

2004-09-22 Thread luke
resolved with if(empty()) - apologies. [EMAIL PROTECTED] wrote: > hi there, > > i am using implode to get the contents of an array into a single variable: > > $enterprises = implode(",", $enterprise) //enterprise contains the array. > > however, if the array is empty (the user didnt select an

Re: [PHP] Implode slows down file reading? [was: str_replace performance in large mailing script]

2003-08-27 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]): > From: "frederik feys" <[EMAIL PROTECTED]> > > > I thought str_replace caused slow down of my mailing script, but it > > seems to be this line of code: > > > > $fd = > > implode("",file("http://www.domain.org/store/min/Mailing_template.html";)

Re: [PHP] Implode slows down file reading? [was: str_replace performance in large mailing script]

2003-08-27 Thread CPT John W. Holmes
From: "frederik feys" <[EMAIL PROTECTED]> > I thought str_replace caused slow down of my mailing script, but it > seems to be this line of code: > > $fd = > implode("",file("http://www.domain.org/store/min/Mailing_template.html";) > ); > > I first put the mailing template in $fd (only once) and th

Re: [PHP] implode()

2002-11-26 Thread Joakim Andersson
Jef wrote: implode() expects an array as the second argument. You're passing a string. In fact with the code you have above I don't see why you don't just tack the comma on the end in the first place: if($image11_name != '') $sqlUpdate .= "image11='$image11_name', "; The reason being the

Re: [PHP] implode()

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 02:57, Jef wrote: > The problem is I don't know which will be the last element in the string. I > am allowing 9 images to be changed, 9 text labels to be changed, and 9 > links to be changed. I don't know which will be the last. I'm using an > update sql command to ch

Re: [PHP] implode()

2002-11-26 Thread Jef
> > > implode() expects an array as the second argument. You're passing a > > > string. In fact with the code you have above I don't see why you don't just tack > > > the comma on the end in the first place: > > > > > >if($image11_name != '') $sqlUpdate .= "image11='$image11_name', "; > > > > T

Re: [PHP] implode()

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 02:19, Jef wrote: > > implode() expects an array as the second argument. You're passing a > > string. In > > > fact with the code you have above I don't see why you don't just tack the > > comma on the end in the first place: > > > >if($image11_name != '') $sqlUpda

Re: [PHP] implode()

2002-11-26 Thread Jef
> implode() expects an array as the second argument. You're passing a string. In > fact with the code you have above I don't see why you don't just tack the > comma on the end in the first place: > >if($image11_name != '') $sqlUpdate .= "image11='$image11_name', "; The reason being the comma a

Re: [PHP] implode()

2002-11-25 Thread Jason Wong
On Tuesday 26 November 2002 14:51, Jef wrote: > I am having difficulty with the implode function. What I am doing is > building a string for an UPDATE SQL command. At the end of the building > portion of the code, I want to insert a comma between the various fields > that will be updated. However,

Re: [PHP] implode()?

2002-11-25 Thread Jami
Ok, figures I would be looking for something else and find the solution. urlencode(). Thanks for the reply Rasmus. :-) Jami - Original Message - From: "Jami" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Monday, November 25, 2002 11:26 PM Subject: [PHP] implode()? I

Re: [PHP] implode()?

2002-11-25 Thread Rasmus Lerdorf
str_replace On Mon, 25 Nov 2002, Jami wrote: > I need help once more. I have a variable that is a string with spaces. What I need >to do is put a "+" sign in the spaces so that the string will print like >"This+is+a+string." I have tried using implode, but I get this error: > > Warning: Bad arg

Re: [PHP] Implode?

2001-02-27 Thread Richard Lynch
> What is the best way to pull data from one table and insert into another? insert into newmembers(name, email, whatever) select name, email, whatever from oldmembers > How can I delete entries from a table with a php document? The same way you select entries. mysql_query() can send *ANY* quer