Hello, I’ve used arrays in the past, but I’ve used them in a different way. I used to use them to replace strings that I want, but now I want to print arrays. My problem is below.
I would like to change the [0], [1], [2], [3], .etc to an actual name. So [0] being something like [id], [1] being [username], .etc.
Hi there,
I’m not sure what your means and I can’t open your attachments.But I guess you want to build a multidimensional array,yes?
If so,I think this is what you want,
Thanks that was exactly what I was looking for. And by the way. Is it possible to change the “Array” word in the beginning to something else? Or is that required?
I may be off base, but my take was you wanted to replace the default numeric keys with more meaningful associative keys, not create a multi-dimensional array.
@blue_sky Thanks. That’s all I wanted to know. If it can’t be change, I’ll just work with it. Thanks a lot.
@Mittineague Thanks for the warm welcome and I know. I only needed a small part of the information that blue_sky gave me. I found out that all I needed was to do something like this.
Thanks for the help. Now I know the difference between which creates brackets and which creates curly braces. Thanks so much. And no, I didn’t read the FAQ. As you can see I’m new so I didn’t know if the FAQ had what I was asking.
The first line sets up $accounts as any empty array, so that it it’s being used in a foreach loop, the foreach loop won’t complain about not being given an array to work with.