arr[0]=The following mainly depends on what type of data content you want to put. For numeric types, no explicit annotation is required. Characters and symbols must be enclosed in double quotes. Of course, if your subscript is a character, you need to add double quotes. This requires special attention. The variable must specify the type of storage. PHP is automatically transformed.
Should we use double quotes or not when assigning values to an array? - PHP Chinese website Q&A - Should we use double quotes or not when assigning values to an array? - PHP Chinese website Q&A
The key name in the array is a variable, and the key value is equivalent to the value of the variable. If there is no variable in a string, it is best to add single quotes. Double quotes will parse the variable, which can be slower according to logic
arr[0]=The following mainly depends on what type of data content you want to put. For numeric types, no explicit annotation is required. Characters and symbols must be enclosed in double quotes. Of course, if your subscript is a character, you need to add double quotes. This requires special attention. The variable must specify the type of storage. PHP is automatically transformed.
Should we use double quotes or not when assigning values to an array? - PHP Chinese website Q&A - Should we use double quotes or not when assigning values to an array? - PHP Chinese website Q&A
Take a look around and learn.
The key name in the array is a variable, and the key value is equivalent to the value of the variable. If there is no variable in a string, it is best to add single quotes. Double quotes will parse the variable, which can be slower according to logic
如果是给数组添加数字型 则可以不加双引号 arr[0] =99;
要是字符串的话就得加上双引号或单引号 : arr[1] = ‘张三’;