static function parseName($name) { if (str::contains($name, '-')) { $match = str::match($name, '!^([0-9]+[\\-]+)!', 0); $uid = str_replace($match, '', $name); $num = trim(rtrim($match, '-')); } else { $num = false; $uid = $name; } return array('uid' => $uid, 'num' => $num); }
static function parseName($name) { $match = str::match($name, '!^([0-9]+[\\-]+)!', 0); $uid = str_replace($match, '', $name); $num = trim(rtrim($match, '-')); return array('uid' => $uid, 'num' => $num); }
function js($url, $async = false) { $url = str::match($url, '~(^\\/\\/|^https?:\\/\\/)~') ? $url : url(ltrim($url, '/')); $async = $async ? ' async' : ''; return '<script' . $async . ' src="' . $url . '"></script>' . "\n"; }