This article mainly introduces ThinkPHP code instances for batch data deletion. For more information, see ThinkPHP's principle of batch data deletion. This is an array. The delete function del () of action is as follows:
/***** The deletion function supports deleting multiple entries and one **/function del () {// dump ($ _ GET ['id']); // $ name = strtolower ($ _ GET ['_ URL _'] [0]); // GET the current Module name $ name = $ this-> getActionName (); $ model = D ($ name); // obtain the operation object of the current module $ id = $ _ GET ['id']; // determine whether the id is an array or a value if (is_array ($ id) {$ where = 'Id in ('. implode (',', $ id ). ')';} else {$ where = 'id = '. $ id;} // dump ($ where); $ list = $ model-> where ($ where)-> delete (); if ($ list! = False) {$ this-> success ("successfully deleted {$ list! ");} Else {$ this-> error ('deletion failed! ');}}