引用管理
+类型分布
+ +被引用最多
+ +暂无数据
+ +-
+
+
- + + + 次 + + +
+ 0 ? '没有符合筛选条件的引用' : '还没有任何引用,去文章里插一个试试'; ?> +
+ + + + + 1): ?> + + + +暂无数据
+ ++ 0 ? '没有符合筛选条件的引用' : '还没有任何引用,去文章里插一个试试'; ?> +
+ + + + + 1): ?> + + + +]*>(.*?)
#is', $html, $m)) { + return ''; + } + + foreach ($m[1] as $raw) { + $text = self::clean(strip_tags($raw)); + + if (self::strLen($text) >= 24) { + return $text; + } + } + + return ''; + } + + /** + * @param string $text + * @return int + */ + private static function strLen(string $text): int + { + return function_exists('mb_strlen') ? mb_strlen($text, 'UTF-8') : strlen($text); + } + + /** + * @param string $text + * @param int $len + * @return string + */ + private static function cut(string $text, int $len): string + { + if (self::strLen($text) <= $len) { + return $text; + } + + return function_exists('mb_substr') + ? mb_substr($text, 0, $len, 'UTF-8') + : substr($text, 0, $len); + } + + /** + * JSON-LD 里的 datePublished + * + * @param string $html + * @return string + */ + private static function jsonDate(string $html): string + { + if (preg_match('#["\']datePublished["\']\s*:\s*["\']([^"\']+)["\']#i', $html, $m)) { + return $m[1]; + } + + return ''; + } + + /** + * @param string $html + * @return string + */ + private static function timeAttr(string $html): string + { + if (preg_match('#