PHP: Using spaces in associative array indices

前端 未结 4 831
故里飘歌
故里飘歌 2021-01-04 01:59

Is this bad practice/can cause problems?

$_SESSION[\'stuff to keep\']

As opposed to calling str_replace() on the indices.

4条回答
  •  心在旅途
    2021-01-04 02:35

    Seems like adding unnecessary whitespace in my opinion... I don't usually use spaces. If you do, though, make sure you quote the array keys.

提交回复
热议问题