SQL - insert语句批量生成

 &$value) {
    $value = trim($value);
    $sqlInfo = preg_replace("/\[(\d+\.\d+)\,(\d+\.\d+)\]/", '{"lng":${1},"lat":${2}}', $value);

    if (($count - 1) == $key) {
        $suffix = ";";
    } else {
        $suffix = ",\n";
    }

    $sql .= "(" . $store_id . "," . $multiIdPreg[1][$key] . ',2,' . $fee . ',\'' . $sqlInfo . '\'' . ")" . $suffix;
}

file_put_contents($file, $sql);

你可能感兴趣的:(laravel,mysql)