<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class FormatUtil { public static function mainDomain($BZIUb) { goto wSznB; wSznB: if (strpos($BZIUb, '//') === 0 || strpos($BZIUb, 'http://') === 0 || strpos($BZIUb, 'https://') === 0) { } else { $BZIUb = 'http://' . $BZIUb; } goto vdnO2; vdnO2: $f3Nqc = parse_url($BZIUb); goto Q1G_F; Q1G_F: if (isset($f3Nqc['host'])) { goto KNSTJ; pez5V: return join('.', array_reverse($TDAzu)); goto E8Mtz; nRT28: foreach (array_reverse(explode('.', $BZIUb)) as $z8JHA) { if (in_array($z8JHA, array('cn', 'com', 'org', 'gov', 'edu'))) { $TDAzu[] = $z8JHA; continue; } else { $TDAzu[] = $z8JHA; } if (count($TDAzu) >= 2) { break; } } goto pez5V; RJbPQ: $TDAzu = array(); goto nRT28; KNSTJ: $BZIUb = $f3Nqc['host']; goto MAWHn; MAWHn: if (preg_match('/^\\d+\\.\\d+\\.\\d+\\.\\d+$/', $BZIUb)) { return $BZIUb; } goto RJbPQ; E8Mtz: } goto H5l6u; H5l6u: return null; goto VCq_L; VCq_L: } public static function telephone($BxkG3) { goto W22RV; a6wBx: if (!preg_match('/^[0-9]{3,20}$/', $BxkG3)) { return null; } goto B6CrS; W22RV: $BxkG3 = str_replace(array('+86', '+', ' ', '(', ')', '-', '（', '）', '', ' ', '　', '"', ';', '	'), '', $BxkG3); goto ABnq4; B6CrS: return $BxkG3; goto JtagQ; ABnq4: $BxkG3 = trim($BxkG3); goto a6wBx; JtagQ: } public static function isPhone($luqU1) { return preg_match('/^1[0-9]{10}$/', $luqU1); } public static function isUUID($UKXQ1) { return preg_match('/^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/', $UKXQ1); } public static function isUrl($m2Dmo) { return preg_match('/^(http|https):\\/\\//', $m2Dmo); } public static function isEmail($NgYCQ) { return preg_match('/^[a-zA-Z0-9_\\-\\.]+@[a-zA-Z0-9_\\-]+[\\.a-zA-Z0-9_\\-]+$/ ', $NgYCQ); } public static function isDomain($BZIUb) { return preg_match('/([a-z0-9]([a-z0-9\\-]{0,61}[a-z0-9])?\\.)+[a-z]{2,10}/i', $BZIUb); } public static function isMoney($E7h4V) { goto hq1_V; hq1_V: if ($E7h4V < 0.01) { return false; } goto OAggB; OAggB: if ($E7h4V > 10000 * 100) { return false; } goto OjRTT; OjRTT: return true; goto Ev4te; Ev4te: } }