0
Can we declare the array's length first instead of directly input the data ?
set the length of the array
3 ответов
0
Just fill the array with empty strings or 0s... example if you wants an array of length 10:
<?php
$cars = array();
for ($x = 0; $x <10; $x++) {
$cars[$x] = "";
}
?>
0
so technically we can't do like what we do in java ?
String [] abc = new String [ length of the array]
0
that's my understanding based on the way we initialize the array.