将自定义CSS类插入函数?

时间:2015-08-22 11:48:26

标签: php class spawn

我想在该代码上使用我的自定义CSS样式,任何想法应该如何完成?

        //Load modules
        if ($handle = opendir('modules'))
        {
            while (false !== ($file = readdir($handle)))
            {
                if ($file != "." && $file != "..")
                {
                    $replace = preg_replace( array ('/(.*?)/', '/[-]/', '/.php/'), array ('$1', ' '), $file);
                    $result = ucfirst($replace);
                    echo '<a href="?inav=';
                    echo $replace;
                    echo '">';
                    echo $result;
                    echo '</a><br>';

                }
            }
            closedir($handle);

我要插入:

<a href="?inav=" class="button101"><span class="user icon">

1 个答案:

答案 0 :(得分:0)

只需添加您需要的回音:

    //Load modules
    if ($handle = opendir('modules'))
    {
        while (false !== ($file = readdir($handle)))
        {
            if ($file != "." && $file != "..")
            {
                $replace = preg_replace( array ('/(.*?)/', '/[-]/', '/.php/'), array ('$1', '&nbsp;'), $file);
                $result = ucfirst($replace);
                echo '<a href="?inav=';
                echo $replace;
                echo '"';
                echo ' class="button101"';
                echo '>';
                echo $result;
                echo '</a><br>';

            }
        }
        closedir($handle);