0

Joomla 1.5 HTMLで作成者を見つけるためにphpコードを挿入できる場合は、phpベースのifループが必要です。その変数を取得したら、IFステートメントを作成できます。

例えば

if ($author="a") {
echo "This is author a";
}

elseif ($author="b"){
echo "this is author b";
}

elseif ($author="c"){
echo "this is author c";
}

記事から$author変数(名前)を取得する方法がわかりません

4

1 に答える 1

0

ifステートメントの代わりに==またはを使用する必要があります====

if ($author == "a") {
    echo "This is author a";
} 

elseif ($author == "b") {
    echo "this is author b";
} 

elseif ($author == "c") {
    echo "this is author c";
}

またはスイッチを使用する

switch ($author) {
    case "a" :
        echo "This is author a";
        break;
    case "b" :
        echo "This is author a";
        break;
    case "c" :
        echo "This is author a";
        break;
}
于 2012-04-24T17:27:23.213 に答える