在函数中插入自定义CSS类


Insert custom CSS class into function?

我想在代码上使用我的自定义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">

只需添加所需的回显:

    //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);