Home >Backend Development >PHP Tutorial > php字符串转化成数组解决思路

php字符串转化成数组解决思路

WBOY
WBOYOriginal
2016-06-13 12:41:23955browse

php字符串转化成数组
如下这段字符串:sex-1-area-2-pagesize-18-pageindex-1  转化成数组

[sex] => 1 [area] => 2 [pagesize] => 18 [pageinde] => 1

我用explode,只能 [0] => sex [1] => 1 [2] => area [3] => 2 这样的

上面的字符串是一个URL传递的参数

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn