Hi,
I'm not sure how to do this. Let's say I have an array that looks
like this:
$timing[$x] = array('Count' =0);
So, basically I've initialized that element of the array with another
array item, that being 'Count'. Later, I want to add another item to
the array, like this:
$timing[$x] = array('Start' =date ("g:i:s"));
How would I do that? I'm sure I cannot use the 'array' function more
than once........do I need to define it and initialize it with nulls?
Along those same lines, can I do something like this: $timing[$x]
['Count']++;
I'm looking for examples, but not finding any on the web. If someone
can help, I'd really appreciate it.
Thank you,
John 8 1314
Mtek wrote:
Hi,
I'm not sure how to do this. Let's say I have an array that looks
like this:
$timing[$x] = array('Count' =0);
So, basically I've initialized that element of the array with another
array item, that being 'Count'. Later, I want to add another item to
the array, like this:
$timing[$x] = array('Start' =date ("g:i:s"));
How would I do that? I'm sure I cannot use the 'array' function more
than once........do I need to define it and initialize it with nulls?
Along those same lines, can I do something like this: $timing[$x]
['Count']++;
I'm looking for examples, but not finding any on the web. If someone
can help, I'd really appreciate it.
Thank you,
John
This works:
$timing[$x]['Count'] = 0;
$timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
--
Norman
Registered Linux user #461062
On May 26, 4:22*pm, Norman Peelman <npeel...@cfl.rr.comwrote:
Mtek wrote:
Hi,
I'm not sure how to do this. *Let's say I have an array that looks
like this:
$timing[$x] = array('Count' *=0);
So, basically I've initialized that element of the array with another
array item, that being 'Count'. *Later, I want to add another item to
the array, like this:
$timing[$x] = array('Start' *=date ("g:i:s"));
How would I do that? *I'm sure I cannot use the 'array' function more
than once........do I need to define it and initialize it with nulls?
Along those same lines, can I do something like this: *$timing[$x]
['Count']++;
I'm looking for examples, but not finding any on the web. *If someone
can help, I'd really appreciate it.
Thank you,
John
This works:
$timing[$x]['Count'] = 0;
$timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
--
Norman
Registered Linux user #461062- Hide quoted text -
- Show quoted text -
What is the difference between that and something like this:
$tables[$x] = array('Acronym' =$table_data[0],
'List' =$table_data[1],
'Name' =$table_data[2]);
I'm really looking for a sturcture like this.......is there any
difference at all???
On May 26, 4:22*pm, Norman Peelman <npeel...@cfl.rr.comwrote:
Mtek wrote:
Hi,
I'm not sure how to do this. *Let's say I have an array that looks
like this:
$timing[$x] = array('Count' *=0);
So, basically I've initialized that element of the array with another
array item, that being 'Count'. *Later, I want to add another item to
the array, like this:
$timing[$x] = array('Start' *=date ("g:i:s"));
How would I do that? *I'm sure I cannot use the 'array' function more
than once........do I need to define it and initialize it with nulls?
Along those same lines, can I do something like this: *$timing[$x]
['Count']++;
I'm looking for examples, but not finding any on the web. *If someone
can help, I'd really appreciate it.
Thank you,
John
This works:
$timing[$x]['Count'] = 0;
$timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
--
Norman
Registered Linux user #461062- Hide quoted text -
- Show quoted text -
What is the difference between that and something like this:
$tables[$x] = array('Acronym' =$table_data[0],
'List' =$table_data[1],
'Name' =$table_data[2]);
I'm really looking for a sturcture like this.......is there any
difference at all???
What about this?
$summary[$x]['seating'] = array('Seating' =$row[0],
'Count' =$row[1]);
Is the word 'seating' like a section title or something?
John
Mtek wrote:
On May 26, 4:22 pm, Norman Peelman <npeel...@cfl.rr.comwrote:
>Mtek wrote:
>>Hi, I'm not sure how to do this. Let's say I have an array that looks like this: $timing[$x] = array('Count' =0); So, basically I've initialized that element of the array with another array item, that being 'Count'. Later, I want to add another item to the array, like this: $timing[$x] = array('Start' =date ("g:i:s")); How would I do that? I'm sure I cannot use the 'array' function more than once........do I need to define it and initialize it with nulls? Along those same lines, can I do something like this: $timing[$x] ['Count']++; I'm looking for examples, but not finding any on the web. If someone can help, I'd really appreciate it. Thank you, John
This works:
$timing[$x]['Count'] = 0; $timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
-- Norman Registered Linux user #461062- Hide quoted text -
- Show quoted text -
What is the difference between that and something like this:
$tables[$x] = array('Acronym' =$table_data[0],
'List' =$table_data[1],
'Name' =$table_data[2]);
I'm really looking for a sturcture like this.......is there any
difference at all???
What about this?
$summary[$x]['seating'] = array('Seating' =$row[0],
'Count' =$row[1]);
Is the word 'seating' like a section title or something?
John
$tables[$x] = array();
indicates $tables[$x] is an array itself.
$tables[$x] = array('Acronym' =$table_data[0],
'List' =$table_data[1],
'Name' =$table_data[2]);
Is just a shortcut method of initializing the array. The result is
exactly the same as:
$tables[$x] = array();
$tables[$x]['Acronym'] = $table_data[0];
$tables[$x]['List'] = $table_data[1];
$tables[$x]['Name'] = $table_data[2];
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Mtek wrote:
On May 26, 4:22 pm, Norman Peelman <npeel...@cfl.rr.comwrote:
>Mtek wrote:
>>Hi, I'm not sure how to do this. Let's say I have an array that looks like this: $timing[$x] = array('Count' =0); So, basically I've initialized that element of the array with another array item, that being 'Count'. Later, I want to add another item to the array, like this: $timing[$x] = array('Start' =date ("g:i:s")); How would I do that? I'm sure I cannot use the 'array' function more than once........do I need to define it and initialize it with nulls? Along those same lines, can I do something like this: $timing[$x] ['Count']++; I'm looking for examples, but not finding any on the web. If someone can help, I'd really appreciate it. Thank you, John
This works:
$timing[$x]['Count'] = 0; $timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
-- Norman Registered Linux user #461062- Hide quoted text -
- Show quoted text -
What is the difference between that and something like this:
$tables[$x] = array('Acronym' =$table_data[0],
'List' =$table_data[1],
'Name' =$table_data[2]);
I'm really looking for a sturcture like this.......is there any
difference at all???
Same thing, I just didn't use the 'array' object to create them.
What about this?
$summary[$x]['seating'] = array('Seating' =$row[0],
'Count' =$row[1]);
Is the word 'seating' like a section title or something?
John
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
On May 26, 7:01*pm, Norman Peelman <npeel...@cfl.rr.comwrote:
Mtek wrote:
On May 26, 4:22 pm, Norman Peelman <npeel...@cfl.rr.comwrote:
Mtek wrote: Hi, I'm not sure how to do this. *Let's say I have an array that looks like this: $timing[$x] = array('Count' *=0); So, basically I've initialized that element of the array with another array item, that being 'Count'. *Later, I want to add another item to the array, like this: $timing[$x] = array('Start' *=date ("g:i:s")); How would I do that? *I'm sure I cannot use the 'array' function more than once........do I need to define it and initialize it with nulls? Along those same lines, can I do something like this: *$timing[$x] ['Count']++; I'm looking for examples, but not finding any on the web. *If someone can help, I'd really appreciate it. Thank you, John
This works:
$timing[$x]['Count'] = 0;
$timing[$x]['Start'] = date("g:i:s");
$timing[$x]['Count']++;
echo var_dump($timing);
--
Norman
Registered Linux user #461062- Hide quoted text -
- Show quoted text -
What is the difference between that and something like this:
* $tables[$x] = array('Acronym' =$table_data[0],
* * * * * * * * * * * 'List' * *=$table_data[1],
* * * * * * * * * * * 'Name' * *=$table_data[2]);
I'm really looking for a sturcture like this.......is there any
difference at all???
Same thing, I just didn't use the 'array' object to create them.
What about this?
* * * $summary[$x]['seating'] = array('Seating' =$row[0],
* * * * * * * * * * * * * * * * * * * 'Count' * =$row[1]);
Is the word 'seating' like a section title or something?
John
--
Norman
Registered Linux user #461062
-Have you been towww.php.netyet?-- Hide quoted text -
- Show quoted text -
So, I'm still a bit unclear what the 'seating' represents.......
Mtek wrote:
On May 26, 7:01 pm, Norman Peelman <npeel...@cfl.rr.comwrote:
>Mtek wrote:
>>On May 26, 4:22 pm, Norman Peelman <npeel...@cfl.rr.comwrote: Mtek wrote: Hi, I'm not sure how to do this. Let's say I have an array that looks like this: $timing[$x] = array('Count' =0); So, basically I've initialized that element of the array with another array item, that being 'Count'. Later, I want to add another item to the array, like this: $timing[$x] = array('Start' =date ("g:i:s")); How would I do that? I'm sure I cannot use the 'array' function more than once........do I need to define it and initialize it with nulls? Along those same lines, can I do something like this: $timing[$x] ['Count']++; I'm looking for examples, but not finding any on the web. If someone can help, I'd really appreciate it. Thank you, John This works: $timing[$x]['Count'] = 0; $timing[$x]['Start'] = date("g:i:s"); $timing[$x]['Count']++; echo var_dump($timing); -- Norman Registered Linux user #461062- Hide quoted text - - Show quoted text - What is the difference between that and something like this: $tables[$x] = array('Acronym' =$table_data[0], 'List' =$table_data[1], 'Name' =$table_data[2]); I'm really looking for a sturcture like this.......is there any difference at all???
Same thing, I just didn't use the 'array' object to create them.
>>What about this? $summary[$x]['seating'] = array('Seating' =$row[0], 'Count' =$row[1]); Is the word 'seating' like a section title or something? John
-- Norman Registered Linux user #461062 -Have you been towww.php.netyet?-- Hide quoted text -
- Show quoted text -
So, I'm still a bit unclear what the 'seating' represents.......
It's simply an array index. Nothing more, nothing less.
$summary[$x]['seating'] is an array element; this element in turn is
another array.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
On May 26, 8:19*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Mtek wrote:
On May 26, 7:01 pm, Norman Peelman <npeel...@cfl.rr.comwrote:
Mtek wrote: On May 26, 4:22 pm, Norman Peelman <npeel...@cfl.rr.comwrote: Mtek wrote: Hi, I'm not sure how to do this. *Let's say I have an array that looks like this: $timing[$x] = array('Count' *=0); So, basically I've initialized that element of the array with another array item, that being 'Count'. *Later, I want to add another itemto the array, like this: $timing[$x] = array('Start' *=date ("g:i:s")); How would I do that? *I'm sure I cannot use the 'array' function more than once........do I need to define it and initialize it with nulls? Along those same lines, can I do something like this: *$timing[$x] ['Count']++; I'm looking for examples, but not finding any on the web. *If someone can help, I'd really appreciate it. Thank you, John This works: $timing[$x]['Count'] = 0; $timing[$x]['Start'] = date("g:i:s"); $timing[$x]['Count']++; echo var_dump($timing); -- Norman Registered Linux user #461062- Hide quoted text - - Show quoted text - What is the difference between that and something like this: * $tables[$x] = array('Acronym' =$table_data[0], * * * * * * * * * * * 'List' * *=$table_data[1], * * * * * * * * * * * 'Name' * *=$table_data[2]); I'm really looking for a sturcture like this.......is there any difference at all???
Same thing, I just didn't use the 'array' object to create them.
>What about this? * * * $summary[$x]['seating'] = array('Seating' =$row[0], * * * * * * * * * * * * * * * * * * * 'Count' * =$row[1]); Is the word 'seating' like a section title or something? John
--
Norman
Registered Linux user #461062
-Have you been towww.php.netyet?--Hide quoted text -
- Show quoted text -
So, I'm still a bit unclear what the 'seating' represents.......
It's simply an array index. *Nothing more, nothing less.
$summary[$x]['seating'] is an array element; this element in turn is
another array.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================- Hide quoted text -
- Show quoted text -
Seems like a good way to organize things.......
Thanks for the explanation...... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eclectic |
last post by:
Hey all,
I have been using usort to sort my multi dimensional arrays ...
function cmp($a, $b){
if($a == $b){
return 0;
}
return ($a < $b) ? -1 : 1;
}
|
by: iop |
last post by:
Hello there,
I'd like to "parse" an entire multi-dimension array like this :
APP
APP
without knowing "framework" or "config" or anything passed as variables...
'cause it's simple to call...
|
by: ip4ram |
last post by:
I used to work with C and have a set of libraries which allocate
multi-dimensional arrays(2 and 3) with single malloc call.
data_type **myarray
=...
|
by: Cant Think Today |
last post by:
I have multi-dimesional arrays that can be specifed by the user, e.g
1,2,3,4,5
1,2,3,4,5,6,7,8,9,10
1,2,3,4,5,6
I think a bit of code that will iterate over these arrays to print out
the...
|
by: Adam Hartshorne |
last post by:
The input to a function of a 3rd party library I want to use requires a
double**, which is a multi-dimension array of doubles.
I have looked on the net etc and seen several ways of supposedly...
|
by: masood.iqbal |
last post by:
All this time I was under the illusion that I understand the concept of
multi-dimensional arrays well ---- however the following code snippet
belies my understanding.
I had assumed all along...
|
by: Kirk Marple |
last post by:
an external API that we're using is giving me back video data in a
multi-dimensional Array (not byte, just System.Array). so, for an HD
quality video, the data is organized as of bytes. i know...
|
by: Robert P. |
last post by:
I can easily store a one-dimensional array in viewstate ( see Test1 )
If I try storing a multi-dimensional array in the viewstate it's crapping
out on me when it goes to serialize the array (not...
|
by: Balaskas Evaggelos |
last post by:
Hi,
does anyone know how i can sort a multi-dimensional array
by a specific field ?
for example i want to sort arr where n=2,
but i need the data of every array to follow that order.
...
|
by: =?Utf-8?B?SGVucmlrIFNjaG1pZA==?= |
last post by:
Hi,
consider the attached code.
Serializing the multi-dimensional array takes about 36s
vs. 0.36s for the single-dimensional array.
Initializing the multi-dimensional array takes about 4s...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |