extract column from multidimentional array



Hi,

below you will find the code for a small script where i'm able to extract a row but not a column.

So the question is how can I do that.

Here is the code:

<?php

$arr = array(
array('00', '01', '02', '03'),
array('10', '11', '12', '13'),
array('20', '21', '22', '23'),
);

$row = $arr[0];
$col = $arr[][0];
print_r($row);
print "\n";
print_r($col);
?>




.



Relevant Pages

  • Re: split regex
    ... >> my grep return the values correct to my array and the values in array ... >>> at the beginning of the script ... >>> d) check the documentation ... >>> don't use if, only use a regex to extract the parts you like, and ...
    (perl.beginners)
  • Re: [PHP] extract column from multidimentional array
    ... On Monday 29 September 2008 09:34:10 pm It flance wrote: ... below you will find the code for a small script where i'm able to extract a ... If you know the column index of the array, ...
    (php.general)
  • Deleting array element does not change the array size.
    ... Below I have a simple script that will build an array then delete an element from it. ... After deleting the element, the size of the array still remains the same. ... print @arr; # outputs "123" ...
    (comp.lang.perl.misc)
  • Re: Logon script - function array and select case not working
    ... this all works well, except, the function i am using for the rules in the control script causes alot of querrys to AD. as there are alot of groups. ... objTSout.writeline retrv ... So if you think that this will assign an array value to the variable, how do you think the case select statement is going go compare this array value with the literal string values such as "group name here"? ... However, by not assigning ANY value to checkgrp in the function, you are guaranteeing that, should the function ever exit, it will return no information. ...
    (microsoft.public.scripting.vbscript)
  • Re: string retrieval issue
    ... Chicago Bears|NFC North ... not writing the third element back to the array). ... You didn't include it in your script. ... Fear is the mind-killer. ...
    (comp.lang.perl.misc)