【发布时间】:2015-08-22 11:48:25
【问题描述】:
我想在该代码上使用我的自定义 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">
【问题讨论】:
-
您的问题到底是什么?回显字符串
class="button101"?!或者你想让 PHP 为.button101生成 CSS 类定义? (你当然不应该那样做,但在<head>中回显<link rel="stylesheet" type="text/css" href="path/to/stylesheet.css"/>)。