zoukankan      html  css  js  c++  java
  • 数据处理

     1
            $po_data = array(
                    "shop_id"=>$shop_id,
                    "name"=>$this->_safe($params["name"]),
                    "supplier_id"=>$this->_safe($params["supplier_id"]),
                    "branch_id"=>$this->_safe($params["branch_id"]),
                    "po_bn"=>$this->_safe($this->generate_password("po")),
                    "purchase_time"=>time(),
                    "amount"=>$amount,
                    "operator"=>$this->_safe($params['operator']),
                    "po_type"=>$this->_safe($params["po_type"]),
                    "arrive_time"=>$this->_safe($params["arrive_time"]),
                    "deposit_balance"=>$this->_safe($params["deposit_balance"]),
                    "product_cost"=>$this->_safe($product_cost),
                    "delivery_cost"=>$this->_safe($params["delivery_cost"]),
                    "memo"=>$this->_safe($params["memo"])?$this->_safe($params["memo"])." ".date("Y-m-d H:i:s",time())." By ".$this->sellerName."<br/>":"",
                    "emergency"=>$params["emergency"]?$params["emergency"]:"false",
            );
    private function _safe($str){
            
            $html_string = array("&amp;", "&nbsp;", "'", '"', "<", ">", "	", "
    ");
            
            $html_clear = array("&", " ", "&#39;", "&quot;", "&lt;", "&gt;", "&nbsp; &nbsp; ", "");
            
            $js_string = array("/<script(.*)</script>/isU");
            
            $js_clear = array("");
            
            $frame_string = array("/<frame(.*)>/isU", "/</fram(.*)>/isU", "/<iframe(.*)>/isU", "/</ifram(.*)>/isU",);
            
            $frame_clear = array("", "", "", "");
            
            
            
            $style_string = array("/<style(.*)</style>/isU", "/<link(.*)>/isU", "/</link>/isU");
            
            $style_clear = array("", "", "");
            
            
            
            $str = trim($str);
            //过滤字符串
            
            $str = str_replace($html_string, "", $str);
            
            //过滤JS
            
            $str = preg_replace($js_string, "", $str);
            
            //过滤ifram
            
            $str = preg_replace($frame_string, "", $str);
            
            //过滤style
            
            $str = preg_replace($style_string, "", $str);
            
            return $str;
            
        }
  • 相关阅读:
    asp:时间的计算
    彻底理解position与anchorPoint
    关于写代码的一些心得总结2014-12-28 23:49:39
    C#如何将线程中的代码抛到主线程去执行
    pac 文件使用到的javascript函数
    webview改变网页宽度
    iOS按钮长按
    ios 页面滑入滑出
    UILable自适应frame
    制作静态库文件(.a文件)
  • 原文地址:https://www.cnblogs.com/sz-xioabai/p/7363495.html
Copyright © 2011-2022 走看看