Declaring static arrays in php

Posted by user220201 on Stack Overflow See other posts from Stack Overflow or by user220201
Published on 2010-12-30T02:31:58Z Indexed on 2010/12/30 2:54 UTC
Read the original article Hit count: 157

Filed under:

Hi,

I am new to php. I was wondering how I could declare a static array in php. Here is what I would do in C. How is the corresponding php code for it?

char a[][] = { (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3) };

From what I read it has to be something like this -

$a = array( 1 => array(1,1), 2 => array(1,2), ... );

Is this correct? If so it sucks :) I hope I am wrong.

Thanks, - Pav

© Stack Overflow or respective owner

Related posts about php