Getting the first character of a string with $str[0]

前端 未结 9 1109
余生分开走
余生分开走 2020-11-28 21:04

I want to get the first letter of a string and I\'ve noticed that $str[0] works great. I am just not sure whether this is \'good practice\', as that notation is

9条回答
  •  渐次进展
    2020-11-28 21:51

    The {} syntax is deprecated as of PHP 5.3.0. Square brackets are recommended.

提交回复
热议问题