Blogger Information
Blog 20
fans 0
comment 0
visits 19753
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php str_getcsv解决explode不能解决的问题
大鱼
Original
833 people have browsed it

<?php
$str = "中国,广东省,广州市,天河区,'113.329884,23.154799',1,'2016-01-01 12:00:00','1,2,3,4,5,6'";$arr = str_getcsv($str, ',', "'");print_r($arr);?>

第三个参数引号 就是代表 引号内的可以无视,分割

输出结果自然是

Array(
   [0] => 中国
   [1] => 广东省
   [2] => 广州市
   [3] => 天河区
   [4] => 113.329884,23.154799
   [5] => 1
   [6] => 2016-01-01 12:00:00
   [7] => 1,2,3,4,5,6)

转自:http://newmiracle.cn/?paged=6&cat=3

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post