<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class FormatUtil { public static function mainDomain($igVv7) { goto KoCd9; YEz9s: return null; goto X80Yh; owg5i: if (isset($N2Xaa['host'])) { goto hlLUT; lr6vO: $KHn4u = array(); goto IsU2I; EN5kk: return join('.', array_reverse($KHn4u)); goto D5bQv; Avpi0: if (preg_match('/^\\d+\\.\\d+\\.\\d+\\.\\d+$/', $igVv7)) { return $igVv7; } goto lr6vO; hlLUT: $igVv7 = $N2Xaa['host']; goto Avpi0; IsU2I: foreach (array_reverse(explode('.', $igVv7)) as $PhYE_) { if (in_array($PhYE_, array('cn', 'com', 'org', 'gov', 'edu'))) { $KHn4u[] = $PhYE_; continue; } else { $KHn4u[] = $PhYE_; } if (count($KHn4u) >= 2) { break; } } goto EN5kk; D5bQv: } goto YEz9s; zGSz4: $N2Xaa = parse_url($igVv7); goto owg5i; KoCd9: if (strpos($igVv7, '//') === 0 || strpos($igVv7, 'http://') === 0 || strpos($igVv7, 'https://') === 0) { } else { $igVv7 = 'http://' . $igVv7; } goto zGSz4; X80Yh: } public static function telephone($wyvQZ) { goto CEVwU; CEVwU: $wyvQZ = str_replace(array('+86', '+', ' ', '(', ')', '-', '（', '）', '', ' ', '　', '"', ';', '	'), '', $wyvQZ); goto vG4TN; oJiTe: return $wyvQZ; goto Hs2Tc; vG4TN: $wyvQZ = trim($wyvQZ); goto e28QP; e28QP: if (!preg_match('/^[0-9]{3,20}$/', $wyvQZ)) { return null; } goto oJiTe; Hs2Tc: } public static function isPhone($cMC59) { return preg_match('/^1[0-9]{10}$/', $cMC59); } public static function isUUID($cXOxg) { return preg_match('/^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/', $cXOxg); } public static function isUrl($iERFh) { return preg_match('/^(http|https):\\/\\//', $iERFh); } public static function isEmail($GJoKv) { return preg_match('/^[a-zA-Z0-9_\\-\\.]+@[a-zA-Z0-9_\\-]+[\\.a-zA-Z0-9_\\-]+$/ ', $GJoKv); } public static function isDomain($igVv7) { return preg_match('/([a-z0-9]([a-z0-9\\-]{0,61}[a-z0-9])?\\.)+[a-z]{2,10}/i', $igVv7); } public static function isMoney($NLqlV) { goto TgLQx; TMxd0: return true; goto yVQw9; TgLQx: if ($NLqlV < 0.01) { return false; } goto rwv6j; rwv6j: if ($NLqlV > 10000 * 100) { return false; } goto TMxd0; yVQw9: } }