php - automatically populate arrays -


strangely enough haven't found question or answers problem (should quite basic), ask here.

in php if have array named myarray don't know contents of, can't this:

$myarray[20] = "some string"; 

because entry 20 may exist.

so there way automatically insert string last entry, nothing overwritten in array?

you add new item array like:

$myarray[] = "some string"; 

this automatically add end of existing array without overwriting existing array entries.


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -