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) {
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
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);
hi,
try to use print_r or var_dump to echo compound data type
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
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
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
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
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
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/
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
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
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.){
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
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
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,
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
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
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
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
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;
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
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
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
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ó:
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
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'),
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
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
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 =
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
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
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
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
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
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
.
= $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
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
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();
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)
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
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
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;
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
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:
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:
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. ;)
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'] =
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 (
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
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
-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
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
53 matches
Mail list logo