/** * 从string中取出http网址,并以逗号连接 * @param string $p_string 逗号组成的多个网址string * @return string 逗号组成的多个网址string */ public static function getHttpStrings($p_string) { $p_stringList = array(); foreach (explode(',', $p_string) as $s) { if (W2String::isURL($s)) { $p_stringList[] = $s; } } return implode(',', $p_stringList); }
/** * 从http请求中获得URL格式字符串 * @param string key * @param bool 允许空白 * @return null|string value */ public static function getRequestURL($p_key, $p_allowBlank = true, $p_default = null) { $_r = $p_default; $_v = static::getRequestString($p_key, $p_allowBlank, $p_default); if (isset($_v) && ($p_allowBlank || W2String::isURL($_v))) { $_r = $_v; } return $_r; }