public static function getKeyWords(string $text, int $maxLen = 60): string
	{
		$keyWords = [];
		// nalezeni vsech linku v textu
		preg_match_all('/<a[^>]*>[^<]+<\/a>/i', $text, $found);
		if (isset($found[0])) {
			foreach ($found[0] as $kw) {
				$keyWords[] = self::lower(self::trim(strip_tags($kw)));
			}
		}

		// h2 a strong
		preg_match_all('/<(h2|strong)[^>]*>[^<]+<\/(h2|strong)>/i', $text, $found);
		if (isset($found[0])) {
			foreach ($found[0] as $kw) {
				$keyWords[] = self::lower(self::trim(strip_tags($kw)));
			}
		}

		$result = implode(', ', array_unique($keyWords));

		return self::truncate($result, $maxLen, '');
	}
public static function getKeyWords(string $text, int $maxLen = 60): string
	{
		$keyWords = [];
		// nalezeni vsech linku v textu
		preg_match_all('/<a[^>]*>[^<]+<\/a>/i', $text, $found);
		if (isset($found[0])) {
			foreach ($found[0] as $kw) {
				$keyWords[] = self::lower(self::trim(strip_tags($kw)));
			}
		}

		// h2 a strong
		preg_match_all('/<(h2|strong)[^>]*>[^<]+<\/(h2|strong)>/i', $text, $found);
		if (isset($found[0])) {
			foreach ($found[0] as $kw) {
				$keyWords[] = self::lower(self::trim(strip_tags($kw)));
			}
		}

		$result = implode(', ', array_unique($keyWords));

		return self::truncate($result, $maxLen, '');
	}
public static function getKeyWords ( string $ text , int $ maxLen = 60 ) : string { $ keyWords = [ ] ; // nalezeni vsech linku v textu preg_match_all ( '/<a[^>]*>[^<]+<\/a>/i' , $ text , $ found ) ; if ( isset ( $ found [ 0 ] ) ) { foreach ( $ found [ 0 ] as $ kw ) { $ keyWords [ ] = self :: lower ( self :: trim ( strip_tags ( $ kw ) ) ) ; } } // h2 a strong preg_match_all ( '/<(h2|strong)[^>]*>[^<]+<\/(h2|strong)>/i' , $ text , $ found ) ; if ( isset ( $ found [ 0 ] ) ) { foreach ( $ found [ 0 ] as $ kw ) { $ keyWords [ ] = self :: lower ( self :: trim ( strip_tags ( $ kw ) ) ) ; } } $ result = implode ( ', ' , array_unique ( $ keyWords ) ) ; return self :: truncate ( $ result , $ maxLen , '' ) ; }
Vrati klicova slova z textu
@param string $text
@param int $maxLen
@return string
Vrati klicova slova z textu