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

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

WBOY
Release: 2016-06-13 12:41:23
Original
959 people have browsed it

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传递的参数

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template