PHP 标签云与圆角字体大小

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 标签云与圆角字体大小相关的知识,希望对你有一定的参考价值。

<ul>
    <?php
      $arr = wp_tag_cloud(array(
        'smallest'   => 8,          // font size for the least used tag
        'largest'    => 40,         // font size for the most used tag
        'unit'       => 'px',       // font sizing choice (pt, em, px, etc)
        'number'     => 200,        // maximum number of tags to show
        'format'     => 'array',    // flat, list, or array. flat = spaces between; list = in li tags; array = does not echo results, returns array
        'separator'  => '',         //
        'orderby'    => 'name',     // name = alphabetical by name; count = by popularity
        'order'      => 'RAND',     // starting from A, or starting from highest count
        'exclude'    => '',         // ID's of tags to exclude, displays all except these
        'include'    => '',         // ID's of tags to include, displays none except these
        'link'       => 'view',     // view = links to tag view; edit = link to edit tag
        'taxonomy'   => 'post_tag', // post_tag, link_category, category - create tag clouds of any of these things
        'echo'       => true        // set to false to return an array, not echo it
      ));
      foreach ($arr as $value) {
        $ptr1 = strpos($value,'font-size:');
        $ptr2 = strpos($value,'px');
        $px = round(substr($value,$ptr1+10,$ptr2-$ptr1-10));
        $value = substr($value, 0, $ptr1+10) . $px . substr($value, $ptr2);
        $ptr1 = strpos($value, "class=");
        $value = substr($value, 0, $ptr1+7) . 'color-' . $px . ' ' . substr($value, $ptr1+7);
        echo '<li>' . $value . '</li> ';
      }
    ?>
  </ul>

以上是关于PHP 标签云与圆角字体大小的主要内容,如果未能解决你的问题,请参考以下文章

在 Xamarin Forms 自定义标签渲染器中,增加边界的大小

调整 UITableViewCell 的大小以适合标签或图像和圆角

PHP图像动态调整大小和圆角图像

配置 Tesseract OCR 以读取相同字体大小的单词

用php过滤html部分标签

更改标签栏的高度和宽度并添加圆角