Home  >  Article  >  Backend Development  >  How to implement multi-condition classification list and filtering in PHP? (code example)

How to implement multi-condition classification list and filtering in PHP? (code example)

不言
不言forward
2018-10-10 16:46:475723browse

The content of this article is about how to implement multi-condition classification list and filtering in PHP? (Code sample) has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

# PHP multi-condition classification list filtering function development example, front-end and back-end implementation together. Back-end docking can splice sql statements, PHP filters through hidden values ​​in form values, commonly used and practical!

Form filtering core function

function Filter(a, b) { 
    var $ = function(e) { 
        return document.getElementById(e); 
    } 
    var ipts = $('filterForm').getElementsByTagName('input'), result = []; 
    for (var i = 0, l = ipts.length; i < l; i++) { 
        if (ipts[i].getAttribute(&#39;to&#39;) == &#39;filter&#39;) { 
            result.push(ipts[i]); 
        } 
    } 
    if ($(a)) { 
        $(a).value = b; 
        for (var j = 0, len = result.length; j < len; j++) { 
 
            if (result[j].value == &#39;&#39; || result[j].value == &#39;0&#39;) { 
                result[j].parentNode.removeChild(result[j]); 
            } 
        } 
        document.forms[&#39;filterForm&#39;].submit(); 
    } 
    return false; 
}

The above is the detailed content of How to implement multi-condition classification list and filtering in PHP? (code example). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete