1. 程式人生 > 其它 >PHP陣列轉字串後提交mysql的解決方案

PHP陣列轉字串後提交mysql的解決方案

技術標籤:php

       $user_id = $_POST['user_id'];
        $array = $_POST["user_sensor"];
        $user_sensor = implode(",", $array);
        $db->update('admin', array('user_sensor' => $user_sensor), array('user_id' => $user_id));

Done!