PHP array access to some problem guessing
First: It is said that the PHP array is a copy of the Perl array, but its use has been simplified.
So, to access the members of an array is naturally:
$ array name [key name]
Or
$ array Name {key Name}
In Perl, the [] index refers to an array, and {} is dedicated to a hash array.
However, there is no description of the {} index in the official PHP documentation. is only present in the user commentary. Naturally, I think these users must have read the PHP source code. Maybe it was a casual test.
But anyway, if you don't look at the source code, there is no way to know the real difference between the two.
?
Another point is that you can access a single character in a string in an array way. However, if the variable is empty. Use an array to write a string to it, then the group.
?
For strings, I personally prefer to use the {} index access. The fundamental purpose of this is to differentiate it from the array. Indicates that this variable is a string.
?
For the difference between [] and {}, you need to look at the source code for a second time. Just make a record in some.