-1
任何人都知道如何僅在wordpress中排除get_the_content()函數的第一個字母?從get_the_content()wordpress函數中排除句子的第一個字母
可能是這樣的片段,但它不起作用!
substr(strip_tags(get_the_content()), 1, get_the_content().length)
感謝很多提前:)
任何人都知道如何僅在wordpress中排除get_the_content()函數的第一個字母?從get_the_content()wordpress函數中排除句子的第一個字母
可能是這樣的片段,但它不起作用!
substr(strip_tags(get_the_content()), 1, get_the_content().length)
感謝很多提前:)
你並不需要第三個參數,只寫:
substr(strip_tags(get_the_content()), 1)
你可能在尋找這樣的事情
$content = get_the_content();
$content = strip_tags($content);
$content = substr($content, 1, strlen($content));
你幾乎有它。只需要使用strlen()函數來獲取字符串的長度。
http://php.net/strlen – 2010-10-26 08:54:28
參考文獻:[PHP字符串函數(http://www.php.net/手動/ EN/ref.strings.php) – 2010-10-26 09:02:31