I am thinking to give up on an associative array of multi-dimension for this code and move to numeric arrays; after searching the net fairly exhaustively, I've not found a similar example of a multidimensional associative array (that works).
After looking at the tutorial, the problem may be as simple as this:
As I have missed, it seems, that to update an array in PHP we need to add the "[]", so the tutorial says... so I'll try to just initialize the array and then update each time using the "[]" construct ... I hope it is that simple !
Last edited by Neo; 10-01-2011 at 07:30 AM..
Reason: Added reference to link
Dear all,
We are planning on upgrading our current HP unix 64 bites from version 11.0 to 11.11. I would like to find out all the possible problems that we will encounter especially on the application side. Can anyone provide me with list(s) or link(s) where I can find out more information?
... (0 Replies)
hi,
i have 3 fields in a file and linked them through 2 associative arrays.. the problem is one of the associative array is working while the other is not.. the code part is:
awk ' BEGIN {
FS="|"
rc = getline < "ICX_RULES"
while ( rc == 1 )
{
rule_id=$1
rule_parameter=$2... (2 Replies)
Hi,
I'm looking for help trying to parse a data stream. Any help would be greatly appreciated.
My awk statement is
awk '/Aug/{a=$2}/vol/{print a, host, $1, $2, $3, $4, $5}' out.txt
Sample Data Stream "out.txt"
-----------------------------
# Aug 3 00:00:00 2008
===== DF =====... (3 Replies)
Hi.
I have a file with the following structer:
DB DISK LOCATION SIZE
============================================
PROD DATA_01 /dev/dm-23 10
PROD DATA_02 /dev/dm-24 10
PROD DATA_03 /dev/dm-25 10
DEV DATA_04 /dev/dm-26 10
DEV DATA_05 ... (1 Reply)
PHP question...I posted this on the Web Development forum, but maybe this is a better place!
I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names.
So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person... (3 Replies)
PHP question...
I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names.
So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person with values "Fred", "Bert", "Tom" etc
So what I want to do is display the... (3 Replies)
Guys,
I need to iterate populate an array while going over files in directory. Can someone please tell me syntax I tried this but it isn't working ==>
for F in `ls -p "${directory1}" | grep -v "\/"`
do
cd "${directory2}"
cmp "${directory2}"/"${F}" "${directory1}"/"${F}" ... (2 Replies)
Hi,
I need an elegant solotion in php. I need to compare 2 arrays (array1 & array2), to find all instances of array 2 which is not in array1.
I don't want to see any instances of array1 wich is not in array2 (here "the")
Array1: This, is, the, data, of, array1
Array2: this, is, data, Of,... (2 Replies)
Hi,
I have to create a JList and the items I need to display are store in HashMap table. What would be the easiest way to populate this JList. Basically the items I want to display/show in the JList are the key values of the HashMap. Thanks in advance for any suggestions. (0 Replies)
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies
LEARN ABOUT PHP
stream_context_create
STREAM_CONTEXT_CREATE(3) 1 STREAM_CONTEXT_CREATE(3)stream_context_create - Creates a stream contextSYNOPSIS
resource stream_context_create ([array $options], [array $params])
DESCRIPTION
Creates and returns a stream context with any options supplied in $options preset.
PARAMETERS
o $options
- Must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value. Default to an empty array.
o $params
- Must be an associative array in the format $arr['parameter'] = $value. Refer to context parameters for a listing of standard
stream parameters.
RETURN VALUES
A stream context resource.
CHANGELOG
+--------+---------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------+
| 5.3.0 | |
| | |
| | Added the optional $params argument. |
| | |
+--------+---------------------------------------+
EXAMPLES
Example #1
Using stream_context_create(3)
<?php
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en
" .
"Cookie: foo=bar
"
)
);
$context = stream_context_create($opts);
/* Sends an http request to www.example.com
with additional headers shown above */
$fp = fopen('http://www.example.com', 'r', false, $context);
fpassthru($fp);
fclose($fp);
?>
SEE ALSO stream_context_set_option(3), Listing of supported wrappers ("Supported Protocols and Wrappers"), Context options ("Context options and
parameters").
PHP Documentation Group STREAM_CONTEXT_CREATE(3)