Convert the first element of an array to a string in PHP

后端 未结 13 1748
盖世英雄少女心
盖世英雄少女心 2020-12-05 02:00

I have a PHP array and want to convert it to a string.

I know I can use join or implode, but in my case array has only one item. Why do I

13条回答
  •  半阙折子戏
    2020-12-05 02:57

    implode or join (they're the exact same thing) would work here. Alternatively, you can just call array_pop and get the value of the only element in the array.

提交回复
热议问题