diff --git a/code/app/common.php b/code/app/common.php index 3c70743..8c4f07a 100644 --- a/code/app/common.php +++ b/code/app/common.php @@ -494,66 +494,6 @@ namespace { } } - /** - * // 调用函数生成随机 HTML - * generateRandomHTML(10, 30); // 随机生成 10~30 个标签 - * - * @param integer $minTags - * @param integer $maxTags - * @return void - */ - function generateRandomHTML($minTags = 5, $maxTags = 20) - { - // 可随机生成的标签字符集 - $tagCharset = 'abcdefghijklmnopqrstuvwxyz'; - - // 属性的随机字符集 - $attrCharset = 'abcdefghijklmnopqrstuvwxyz'; - - // 可生成的属性名称 - $possibleAttributes = ['draggable', 'date-time', 'lang', 'id', 'dir', 'class']; - - // 标签的最大长度和属性值的最大长度 - $tagMaxLength = 8; // 标签名的最大长度 - $attrValueMaxLength = 10; // 属性值的最大长度 - - // 随机生成的标签数量 - $numTags = rand($minTags, $maxTags); - - $htmlResult = ''; - - for ($i = 0; $i < $numTags; $i++) { - // 随机生成标签名称 - $tagName = randomString(rand(3, $tagMaxLength), $tagCharset); - - // 随机生成属性数量 - $numAttributes = rand(1, 3); // 每个标签随机生成 1~3 个属性 - $attributes = ''; - - for ($j = 0; $j < $numAttributes; $j++) { - // 随机选择属性名称 - $attrName = $possibleAttributes[array_rand($possibleAttributes)]; - // 随机生成属性值 - $attrValue = randomString(rand(3, $attrValueMaxLength), $attrCharset); - $attributes .= " {$attrName}=\"{$attrValue}\""; - } - - // 拼接随机标签 - $htmlResult .= "<{$tagName}{$attributes}>{$tagName}>\n"; - } - - return $htmlResult; - } - // 辅助函数:生成随机字符串 - function randomString($length = 8, $charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') - { - $charsetLength = strlen($charset); - $randomString = ''; - for ($i = 0; $i < $length; $i++) { - $randomString .= $charset[rand(0, $charsetLength - 1)]; - } - return $randomString; - } // 随机颜色生成函数 function getRandomColor() diff --git a/code/app/home/view/kuangyu/Pc/Public/footer.html b/code/app/home/view/kuangyu/Pc/Public/footer.html index 084458c..3231577 100644 --- a/code/app/home/view/kuangyu/Pc/Public/footer.html +++ b/code/app/home/view/kuangyu/Pc/Public/footer.html @@ -3,7 +3,7 @@
友情链接