摘要:
function show($code, $message, $data = [], $httpCode = 200) { $result = [ 'code' => $code, 'msg' => $message, 'data' => $data, ]; return json($result, $httpCode); } 阅读全文
摘要:
function getOrderSn(){ $yCode = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'); $orderSn = $yCode[intval(date('Y')) - 2011] . strtoupper(dechex(date('m'))) . date('d') . substr(time(... 阅读全文
摘要:
function xml_to_arr($xml){//xml字符串转数组 $objectxml = simplexml_load_string($xml,'SimpleXMLElement', LIBXML_NOCDATA);//将文件转换成 对象 $xmljson= json_encode($objectxml );//将对象转换个JSON $xmlar... 阅读全文
摘要:
function is_wechat() { $ug= isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:''; if( stripos($ug,'micromessenger') !== false ){ return true; } return false; } ... 阅读全文
摘要:
function remove_emoji($string) { $regex_emoticons = '/[\x{1F600}-\x{1F64F}]/u'; $clear_string = preg_replace($regex_emoticons, '', $string); // Match Miscellaneous Symbols and Pictographs $regex_symbo 阅读全文