Please bare with my I'm used in C++. I want to use an array in PHP (with variable size) but it must be filled with zeroes uppon declaration. I know that I shouldn't "declare" variables and arrays in PHP but I need it filled before use.
$counter[] = {0}; Sends out an "unexpected '{' in line 53" error although this would perfectly work in C++. I had wrote that code in another server and it worked perfectly (in PHP) but it stoped working when I moved the files. What can I use for similar results?
C++ !== PHP- Perhaps consider using array_fill() to create it?{0}has ever been valid syntax in PHP - just0should do the job. Or usearray_fill, as @MarkBaker says.