How do I truncate this PHP
How do I truncate this PHP
Out of context: Reply #11
- Started
- Last post
- 16 Responses
- effour0
This worked great, anyone know how I can make sure it doesn't cut off words? It currently cuts off at characters
Thanks!
$mycontent = get_the_content();
$mycontent = substr($mycontent, 0, 100)."...";
$mycontent = apply_filters('the_content', $mycontent);
$mycontent = str_replace(']]>', ']]>', $mycontent);
echo $mycontent;