Heya, x1y1z1. Welcome to TSDN!
how to declare this c array(eg:int var[10]))in php.
Hm. Where to begin on this one?
PHP variables are significantly different from C variables. C variables are statically-typed (e.g., int myVar can only hold int values, etc.).
On the other hand, PHP values are dynamically-typed. So you could do this without causing any problems:
-
$myVar = 5;
-
$myVar = 'Hi!';
-
Having said that, to declare an array in PHP, you'd just use the array keyword:
-
$myVar = array(
-
'key' => 'value'
-
);
-
The array can have as many or as few elements as you want. You don't have to specify this when you create the array.
For more information, check out the PHP Manual:
http://php.net/variables