1.举例:

     $a=array(1=>5,5=>8,22,2=>'8',81);
     Echo $a[7];//81
     Echo $a[6];//22
     Echo $a[3];//报错

    关于数组索引顺序以及关联数组下标问题

2.举例:

     $a[bar]='hello';
     Echo $a[bar];//hello
     echo $a['bar'];//hello

    虽然出结果,但也会报错,使用未定义的常量

有引号没引号还是有区别的,虽然都能出结果.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-05-19
  • 2021-04-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2021-05-21
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案