小知識點總結_PHP教程

來源:互聯網
上載者:User
checkbox 用法

 />推薦[c]    />特薦[a]    />頭條[h]    />熱門[o]    />最新[n]

這裡strpos是檢測字串中是否包含某個字串!

strpos 返回整數(找不到返回邏輯假)
'true' 在數值比較中被轉換為 0
如果 $row['flag'] 第一個字元為 c 時,恰巧被匹配
其他字元返回的都不是 0,所以不會匹配成功。

當參數傳遞為字串是如何轉變成數組與顯示輸出。

 

資料庫插入

else if($_GET['do']=='editok'){$id = $_POST['id'];$checked = $_POST['checked'];$flag = $_POST['flags'];$flags=implode(",",$flag);$sql = 'update djs_skstudent_voice set checked='.$checked.',flag="'.$flags.'" where id='.$id;$dsql->ExecuteNoneQuery($sql);echo "";}

http://www.bkjia.com/PHPjc/729845.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/729845.htmlTechArticlecheckbox 用法 input id="flagc" type ="checkbox" value="c" name="flags[]"?php if(strpos($row['flag'],'c')!==false) echo "checked='checked'" ;?/推薦[c] input id="flaga" type ="ch...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.