$cc = file_get_contents('data/phone_log.txt');
$arrConts = explode("\n",$cc);
foreach($arrConts as $ccc){
$ccc = json_decode(stripslashes($ccc), true);
...处理json
插入数据库
}
mysql表的id是自增的,没有插入
$query = "INSERT INTO logs SET name='".$ccc[name]."',state=1,domain='".$domain."',data='".$new."'";
mysql_query($query);
打开文本获得json数组,然后处理,但是多行的时候每次只插入第一个数据