AI助手支持GPT4.0
A couple of simple php functions that, when passed a string of text and a length value, strips the text of html tags and markup, and cuts it to the specified length.
几个简单的PHP函数,当传递一个字符串和一个长度值时,会剥离html标记和标记的文本,并将其剪切为指定的长度。 p>
clencut_w returns the given number of words or less, cleancut_c returns given number of characters or less.
clencut_w返回给定的字符数或更少,cleancut_c返回给定的字符数或更少。
Only complete words are returned.
仅返回完整的单词。 p>
They can be called as cleancut_w($string,$length) and cleancut_c($string,$length=50) from any template file.
cleancut_w($string,$length)
cleancut_c($string,$length=50)
在任何模板文件中,它们都可以称为 cleancut_w($ string,$ length) code>和 cleancut_c($ string,$ length = 50) code>。 p>Example: 示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.?> code>。 p>
cleancut_w($ string,$ length) code>和 cleancut_c($ string,$ length = 50) code>。 p>Example: 示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.?> code>。 p>
cleancut_c($ string,$ length = 50) code>。 p>Example: 示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.?> code>。 p>
Example: 示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.?> code>。 p>
示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.?> code>。 p>
示例: <?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>.
<?php $ text_clean = cleancut_w($ sometext,50); echo $text_clean;echo $ text_clean; ?>
echo $text_clean;
echo $ text_clean;
?>
?> code>。 p>
cct_cleancut.php
/wp-content/plugins/
cct_cleancut.php code>复制到 / wp-content / plugins / code>目录。 li>Activate it.激活它。 li>Now you can use cleancut_w($string,$length) and cleancut_c($string,$length=50) in your templates.现在,您可以在模板中使用 cleancut_w($ string,$ length) code>和 cleancut_c($ string,$ length = 50) code>。 li>
/ wp-content / plugins / code>目录。 li>Activate it.激活它。 li>Now you can use cleancut_w($string,$length) and cleancut_c($string,$length=50) in your templates.现在,您可以在模板中使用 cleancut_w($ string,$ length) code>和 cleancut_c($ string,$ length = 50) code>。 li>
cleancut_w($ string,$ length) code>和 cleancut_c($ string,$ length = 50) code>。 li>
cleancut_c($ string,$ length = 50) code>。 li>
ol>
原文出处:http://www.sanshu.cn/a/7440.html
群主管理都是支付大佬