String to Array and Back

后端 未结 9 2471
自闭症患者
自闭症患者 2020-12-22 07:19

I have a string, how do I convert it to an array?

After manipulating that array, how do I again make it into a string?

Do strings in PHP behave the same way

9条回答
  •  执笔经年
    2020-12-22 07:39

    explode ( string $delimiter , string $string [, int $limit ] )
    

    ... and after changes ...

    implode ( string $glue , array $pieces )
    

    check out http://php.net/explode
    and http://php.net/implode

    You can also use split or join which, as far as I know, support regex

提交回复
热议问题