// 拆分sql语句
function sqlSplit($sql){
$num = 0;
$result = array();
$sql = str_replace("\r", "\n", $sql);
$splitArray = explode(";\n", trim($sql."\n"));
unset($sql);
foreach($splitArray as $query){
$result[$num] = '';
$queryArr = explode("\n", trim($query));
$queryArr = array_filter($queryArr);
foreach($queryArr as $query){
$firstChar = substr($query, 0, 1);
if($firstChar != '#' && $firstChar != '-'){
$result[$num] .= $query;
}
}
$num++;
}
return $result;
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询