[PHP] Implode a 2D Array

2009-07-02 Thread salmarayan
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] = AFMC.CA [quantity] = 200 ) ,

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] = AFMC.CA

[PHP] implode()

2008-11-18 Thread Terion Miller
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 Yeti
with implode one can reverse the function arguments i know .. but ?php $BannerSize = ''; if (isset($_POST['BannerSize']) is_array($_POST['BannerSize'])) { $BannerSize = implode(',', $_POST['BannerSize']); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

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 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 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

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 You appear

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 generated

[PHP] Implode? Explode?

2005-06-06 Thread Jack Jackson
Hi all, 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 wrong for this - the only separator I can see is

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 ) {

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

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 wrong

[PHP] implode errors if array empty

2004-09-22 Thread luke
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 anything in the form), the implode function errors out. can anyone think of a way

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 anything

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: ?php $array = array(); $comma_separated = implode(,, $array); echo $comma_separated; ? It does not send any errors back. If you

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 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 unsubscribe,

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

2003-08-28 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;) ); I first

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

2003-08-27 Thread frederik feys
Hi all, 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 then replace (str_replace) elements of it to

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 then replace

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 at the

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 != '') $sqlUpdate .=

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

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

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

[PHP] implode()?

2002-11-25 Thread Jami
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 arguments to implode() The code I am using is as follows:

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 arguments

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 need

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, it

[PHP] implode()

2002-11-25 Thread Jef
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, it is not working. Here is a portion of my

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* query

[PHP] Implode?

2001-02-25 Thread Kenneth R Zink II
What is the best way to pull data from one table and insert into another? How can I delete entries from a table with a php document? The gist of what I'm trying to accomplish is this. This is somewhat of a detailed outline, so please bear with me. 1. I have one table (members) that has all the