0
我已經升級我的WordPress網站,並獲得在頭警告,我是新手在PHP,但發現答案由count
更換strlen
,然後我得到一個警告用count替換strlen新警告如何重寫函數正確?
function head() {
if (strlen ($this->description) > 0) {
// if (count ($this->description) > 0) {
if (function_exists ('mb_substr'))
$description = mb_substr (strip_tags ($this->description), 0, $this->max_length);
else
$description = substr (strip_tags ($this->description), 0, $this->max_length);
$description = trim (preg_replace ("/[\r\n ]+/", ' ', $description));
$description = HeadSpace_Plugin::specialchars ($description);
echo '<meta name="description" content="'.$description.'" />'."\r\n";
}
}
有人可以幫我改寫這個功能嗎?謝謝
發佈您獲得的完整警告。 – Rikesh