[PHP] array problem

2011-09-09 Thread Marc Fromm
I am reading a csv file into an array. The csv file. users.csv file contents: w12345678,a w23456789,b w34567890,c $csvfilename = users.csv; $handle = fopen($csvfilename, r); if($handle) {

Re: [PHP] array problem

2011-09-09 Thread Joshua Stoutenburg
The function fgetcsv() returns an array. http://php.net/manual/en/function.fgetcsv.php On Fri, Sep 9, 2011 at 9:00 AM, Marc Fromm marc.fr...@wwu.edu wrote: I am reading a csv file into an array. The csv file. users.csv file contents: w12345678,a w23456789,b w34567890,c

Re: [PHP] array problem

2011-09-09 Thread Steve Staples
On Fri, 2011-09-09 at 16:00 +, Marc Fromm wrote: I am reading a csv file into an array. The csv file. users.csv file contents: w12345678,a w23456789,b w34567890,c $csvfilename = users.csv; $handle = fopen($csvfilename, r);

Re: [PHP] array problem

2011-09-09 Thread Adam Balogh
hi, try to use print_r or var_dump to echo compound data type

Re: [PHP] array problem

2011-09-09 Thread Ashley Sheridan
You are echoing out an array. If you use something like print_r() or var_dump() you will see the array elements Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Marc Fromm marc.fr...@wwu.edu wrote: I am reading a csv file into an

Re: [PHP] Array problem

2010-10-28 Thread Richard Quadling
On 27 October 2010 22:15, Kevin Kinsey k...@daleco.biz wrote: Marc Guay wrote: As Nicholas pointed out, the extra underscore in the key is the issue. That's way too easy a fix.  I think he should check to make sure his version of PHP was compiled with the right extensions and that the

RE: [PHP] Array problem

2010-10-28 Thread Bob McConnell
From: Richard Quadling On 27 October 2010 22:15, Kevin Kinsey k...@daleco.biz wrote: Marc Guay wrote: As Nicholas pointed out, the extra underscore in the key is the issue. That's way too easy a fix.  I think he should check to make sure his version of PHP was compiled with the right

Re: [PHP] Array problem

2010-10-27 Thread Kevin Kinsey
Marc Guay wrote: As Nicholas pointed out, the extra underscore in the key is the issue. That's way too easy a fix. I think he should check to make sure his version of PHP was compiled with the right extensions and that the browser isn't doing something unpredictably bizarre when submitting

[PHP] array problem with a zencart shipping module

2008-02-06 Thread John Taylor-Johnston
I'm desperately going outside the forum, seeking help. Does anyone have any experience with Zencart shipping modules, or understand arrays? http://www.zen-cart.com/forum/showthread.php?t=87831 Its borrowed code and I,m not good at arrays to begin with. Thanks, John -- PHP General Mailing List

Re: [PHP] array problem with a zencart shipping module

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 11:11 PM, John Taylor-Johnston [EMAIL PROTECTED] wrote: I'm desperately going outside the forum, seeking help. Does anyone have any experience with Zencart shipping modules, or understand arrays? http://www.zen-cart.com/forum/showthread.php?t=87831 maybe you should stick w/

Re: [PHP] array problem with a zencart shipping module

2008-02-06 Thread John Taylor-Johnston
Thanks for the reply and checking it out. I was hoping my problem lies only in the class. I do have a Paypal account and at this point in time, it is a question of time - I've got to get my site in production and shut off the old cart. Nathan Nobbe wrote: On Feb 6, 2008 11:11 PM, John

Re: [PHP] array problem with a zencart shipping module

2008-02-06 Thread Paul Scott
On Wed, 2008-02-06 at 23:42 -0500, Nathan Nobbe wrote: ouch, maybe you need to hire someone ? besides this has more to do than just arrays; there is the rest of the application and clearly anyone whos going to help out must understand at least some of it.. Yeah, I concur! You really should

[PHP] Array problem

2007-10-17 Thread Merlin
Hi there, I am pulling picture ids out of a db and comment ids. The comments belong to the pic ids and are stored in two seperate tables. I am having trouble with the arrays to display them after pulling out of the db. The data is filled like this: while (rows etc.){

Re: [PHP] Array problem

2007-10-17 Thread Zoltán Németh
2007. 10. 17, szerda keltezéssel 13.08-kor Merlin ezt írta: Hi there, I am pulling picture ids out of a db and comment ids. The comments belong to the pic ids and are stored in two seperate tables. I am having trouble with the arrays to display them after pulling out of the db. The

RE: [PHP] Array problem

2007-10-17 Thread Ford, Mike
On 17 October 2007 12:09, Merlin wrote: Hi there, I am pulling picture ids out of a db and comment ids. The comments belong to the pic ids and are stored in two seperate tables. I am having trouble with the arrays to display them after pulling out of the db. The data is filled like

Re: [PHP] array problem

2006-04-23 Thread Brian V Bonini
On Sat, 2006-04-22 at 15:31, Martin Alterisio wrote: You're wrong, he isn't using an associative array, since the keys used are only integers. Well, if you really want to argue semantics then technically we're both wrong because there are no different indexed and associative array types in PHP,

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-23 Thread Brian V Bonini
On Sat, 2006-04-22 at 14:16, Jochem Maas wrote: with regard to Suresh - do you, Brian, know how many times he has posted similar question to this list this year? (this is the first time he has even given an indication that he knows where the manual is let alone opened it btw) do you know

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-23 Thread Dave Goodchild
Tiresome. On 23/04/06, Brian V Bonini [EMAIL PROTECTED] wrote: On Sat, 2006-04-22 at 14:16, Jochem Maas wrote: with regard to Suresh - do you, Brian, know how many times he has posted similar question to this list this year? (this is the first time he has even given an indication that

[PHP] array problem

2006-04-22 Thread suresh kumar
sorry.earlier i mistyped some values. I am facing one project in my project . this is my code: a=array(0=10,1=10,2=40,3=30,4=30,5=10); b=array(); b=array_unique($a); print_r($b); o/p getting from above code is b[0]=10,b[2]=40,b[3]=30,b[5]=10; but i want the

Re: [PHP] array problem

2006-04-22 Thread Brian V Bonini
On Sat, 2006-04-22 at 07:09, suresh kumar wrote: sorry.earlier i mistyped some values. I am facing one project in my project . this is my code: a=array(0=10,1=10,2=40,3=30,4=30,5=10); b=array(); b=array_unique($a); print_r($b); o/p getting from above code

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-22 Thread Jochem Maas
suresh kumar wrote: sorry.earlier i mistyped some values. I am facing one project in my project . this is my code: a=array(0=10,1=10,2=40,3=30,4=30,5=10); b=array(); b=array_unique($a); print_r($b); o/p getting from above code is b[0]=10,b[2]=40,b[3]=30,b[5]=10;

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-22 Thread Brian V Bonini
Jochem's site: snip http://iamjochem.com/mariecke/index.php Mariecke's daily ramblings (almost) in dutch english... this page is using output from a drupal system. If nothing else they have a nice logo. ;) Warning: main(./../blog/parse.php): failed to open stream: No such file or directory

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-22 Thread Jochem Maas
thanks Brian. that site has not worked for, oh, 3 years - I don't see what some broken code on some site I haven't done anything with in years has got to do with programmer ethic (or whatever advice you were refering to). - am I bugging you for a fix? with regard to Suresh - do you, Brian, know

Re: [PHP] array problem

2006-04-22 Thread Martin Alterisio
You're wrong, he isn't using an associative array, since the keys used are only integers. array(10,10,40,30,30,10); and array(0=10,1=10,2=40,3=30,4=30,5=10); create the same array. The problem is that array_unique preserves keys (read the manual!!!) If you don't want this, use array_values() to

Re: [PHP] Array problem

2005-03-26 Thread [EMAIL PROTECTED]
May be this help you: $data=$_POST['position']; $positions=array_keys($data); foreach($positions as $pos){ $row=$data[$pos]; foreach($row as $value){ $sql=INSERT INTO table_name (field_name)VALUES ('$value'); $cursor=mysql_query($sql); } } Devta. [EMAIL PROTECTED] escribió:

[PHP] Array problem

2005-03-25 Thread virtualsoftware
Hi, I have a form like this: form action=products.php method=post input name=position[pos][value 1] type=text id=position[pos][value 1] value=number 1 input name=position[pos][value 2] type=text id=position[pos][value 2] value=number 2 input name=position[pos][value 3] type=text

[PHP] array problem

2005-01-21 Thread Ahmed Abdel-Aliem
hi if i have an array $listing1 = array(array('title'='yahoo', 'redirect'='www.yahoo.com', 'info'='yahoo website'), array(title='msn', 'redirect'='www.msn.com', 'info='msn website')); $listing2 = array(array('name'='lycos', 'link'='www.lycos.com', 'description'='lycos website'),

Re: [PHP] array problem

2005-01-21 Thread Richard Lynch
Ahmed Abdel-Aliem wrote: how can i group them together into one array to be : http://php.net/array_merge and friends should help -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Array problem

2004-06-14 Thread Brent Clark
Hi all I have this problem whereby im try to create some kind of an array of a split off a file. //Here I pull the file in the array $contents. $contents = file($hotelpathprod.$hotel); foreach($contents as $arr=$conts){ $ff[] = split(\|,$conts); //Here im trying to

Re: [PHP] Array Problem

2004-04-18 Thread Don Read
On 16-Apr-2004 Flavio Fontana wrote: Hi I have i Problem i got a variable a=2351 now i need to create an array out of this variable a[0]=1 a[1]=3 a[2]=5 a[3]=1 I have an idea to use the modulo function an do some Math but im sure there is a nicer way of solving my prob $a =

[PHP] Array Problem

2004-04-17 Thread Flavio Fontana
Hi I have i Problem i got a variable a=2351 now i need to create an array out of this variable a[0]=1 a[1]=3 a[2]=5 a[3]=1 I have an idea to use the modulo function an do some Math but im sure there is a nicer way of solving my prob thx Flavio -- PHP General Mailing List

Re: [PHP] Array Problem

2004-04-17 Thread Richard Harb
That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } HTH Richard Friday, April 16, 2004, 11:00:49 PM, you wrote: Hi I have i Problem i got a variable a=2351 now i need to create an array out of this variable a[0]=1

Re: [PHP] Array Problem

2004-04-17 Thread Arthur Radulescu
That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } If I remember well strlen is used for checking the length of a string... Arthur Looking for a job!? Use the

Re: [PHP] Array Problem

2004-04-17 Thread Daniel Clark
How about count() That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } HTH Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array Problem

2004-04-17 Thread Richard Harb
Saturday, April 17, 2004, 7:38:46 PM, Arthur Radulescu wrote: That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } If I remember well strlen is used for checking the length of a string... It does ... I didn't look

Re: [PHP] Array Problem

2004-04-17 Thread Tom Rogers
Hi, Saturday, April 17, 2004, 7:00:49 AM, you wrote: FF Hi FF I have i Problem i got a variable a=2351 now i need to create an array out of this variable FF a[0]=1 FF a[1]=3 FF a[2]=5 FF a[3]=1 FF I have an idea to use the modulo function an do some Math but FF im sure there is a nicer way of

Re: [PHP] Array problem

2004-03-22 Thread Firman Wandayandi
. = $columntotals[$count] = $sum; Is right? Sorry, I confuse with your words total of totals? Good Luck, Firman - Original Message - From: noginn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 22, 2004 12:33 AM Subject: [PHP] Array problem This has been confusing me a little

Re: [PHP] Array problem

2004-03-22 Thread noginn
should tried this one. = $columntotals[$count] = $sum; Is right? Sorry, I confuse with your words total of totals? Good Luck, Firman - Original Message - From: noginn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 22, 2004 12:33 AM Subject: [PHP] Array problem This has

[PHP] Array problem

2004-03-21 Thread noginn
This has been confusing me a little for a few hours now. Heres a snip of my code which is causing the problem: $content = table border='0' cellspacing='0' cellpadding='5'\n; $content .= tr\n; $content .= tdnbsp;/td\n; $tasks = new dbconnect; $tasks-connect();

Re: [PHP] Array problem....

2003-12-11 Thread Jas
Well just so you understand why I needed something like that here is the finished result below ?php function show() { require 'path/to/dbconnector.inc'; $sql_subs = mysql_query(SELECT * FROM $t_02,$db)or die(mysql_error()); $i = 0; while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge)

RE: [PHP] Array problem....

2003-12-11 Thread Chris W. Parker
Jas mailto:[EMAIL PROTECTED] on Thursday, December 11, 2003 7:21 AM said: Well just so you understand why I needed something like that here is the finished result below [snip] $i = 0; while(list(...) = mysql_fetch_row(...)) { $_SESSION[$i] = ...; $i++; } I want to change my

Re: [PHP] Array problem....

2003-12-11 Thread Jas
Yeah I understand that and it would be perfect if I only had to call this type of function once on a page... and on any other pages that need something like this I will do it that way but with the counter set to 0 or whatever number I choose which is a sort of view all page so your solutions

[PHP] Array problem....

2003-12-10 Thread Jas
Not very good at arrays so I figured i would look here ?php $sql_subs = mysql_query(SELECT * FROM $t_02,$db)or die(mysql_error()); while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge) = mysql_fetch_row($sql_subs)) { print $sub; print br; print $msk; print br; print $dns01; print br;

RE: [PHP] Array problem....

2003-12-10 Thread Chris W. Parker
Jas mailto:[EMAIL PROTECTED] on Wednesday, December 10, 2003 3:21 PM said: while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge) = mysql_fetch_row($sql_subs)) { $_session['something to automaticly increment session var'] = $sub+$msk+$dns01... } No exactly sure what you mean but here

RE: [PHP] Array problem....

2003-12-10 Thread Chris W. Parker
Chris W. Parker on Wednesday, December 10, 2003 3:27 PM said: while(list(...)) = mysql_fetch_row(...)) { Got one too many ) in there. Should be: while(list(...) = mysql_fetch_row(...)) { Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Array problem....

2003-12-10 Thread Jas
having no idea you could use numbers as session variable names I kinda feel like a retard right now. You solution worked, thank you very much. Jas Chris W. Parker wrote: Jas mailto:[EMAIL PROTECTED] on Wednesday, December 10, 2003 3:21 PM said:

RE: [PHP] Array problem....

2003-12-10 Thread Chris W. Parker
Jas mailto:[EMAIL PROTECTED] on Wednesday, December 10, 2003 3:44 PM said: having no idea you could use numbers as session variable names I kinda feel like a retard right now. You solution worked, thank you very much. It's an array just like any other which you probably realize now. ;)

Re: [PHP] Array problem....

2003-12-10 Thread John W. Holmes
Jas wrote: but what I need to do is something like this... ?php $sql_subs = mysql_query(SELECT * FROM $t_02,$db)or die(mysql_error()); while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge) = mysql_fetch_row($sql_subs)) { $_session['something to automaticly increment session var'] =

[PHP] Array problem in PHP. Please help.

2001-07-12 Thread Michael Champagne
Ok, here's the print_r() output of my 2 arrays. The first really just has an extra dimension. How can I get the format of the first one looking like the bottom one (just an array of key = value pairs)? Thanks! Array ( [0] = Array ( [trade_date] = Trade Date ) [1] = Array (

RE: [PHP] Array problem in PHP. Please help.

2001-07-12 Thread Adrian Ciutureanu
foreach($oldArray as $a)) { list($key, $value) = each($a); $newArray[$key] = $value; } -Original Message- From: Michael Champagne [mailto:[EMAIL PROTECTED]] Sent: 12 iulie 2001 17:37 To: PHP General Mailing List Subject: [PHP] Array problem in PHP. Please help

RE: [PHP] Array Problem

2001-05-22 Thread Matt Schroebel
What is the best way to delete an element from an array? I tried using unset(), and it didn't work. unset works with arrary elements, but it must be a global variable and not passed in. Try the code below to see the results. ?php // deletes an element of global array function

RE: [PHP] Array problem

2001-04-06 Thread Mark Roedel
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 3:20 AM To: [EMAIL PROTECTED] Subject: [PHP] Array problem I am having big problems with merging two arrays. I just can't seem to get my head around it. I have two arrays

Re: [PHP] Array problem

2001-04-06 Thread Joe Stump
This would work ... ? $arrA = array(1,2,3,4,5,6); $arrB = array(9,8,7,6,5); // pick an arbitrary one to start with ... for($i = 0 ; $i = sizeof($arrB) ; ++$i) if(!in_array($arrB[$i],$arrA)) $arrA[] = $arrB[$i]; ? --Joe On Fri, Apr 06, 2001 at 09:19:52AM +0100, Alexis