Is possible to loop trough an array in php like we do it in JavaScript for example without using the for ( $X as $Y){}
For example we in JavaScript we can use this code :
var names=['john','tom','jane'];
for (i=0;i<names.length;i++){
names[i];
}
Now in the case of using the same method for this loop it would be this one and it gives us an error :
$names=['john','tom','jane'];
for ($i=0;$i<$names.length;$i++){
$names[$i];
}
So is there a way around this?