4853 次
2 に答える
6
始めるための非常に簡単な例。
<title><?php
if ( preg_match('/([^\/]+)\/([^\/]+)$/', $_SERVER['PHP_SELF'], $matches) ) {
list($dummy, $profileType, $profileName) = $matches;
$safeProfileType = htmlentities($profileType);
$safeProfileName = htmlentities ($profileName);
echo "This is an $safeProfileType profile for $safeProfileName";
} else {
echo "Unknown profile!";
}
?></title>
アラン・ラロンドのコメントごとに編集。(これが彼の意図したことであることを願っています)
于 2009-01-14T01:40:49.820 に答える
1
ここで何を探しているのか正確にはわかりませんが、動的なタイトルを作成するには、次のことができます。
<title><?php echo $theDynamicTitle; ?></title>
于 2009-01-14T01:23:53.550 に答える