Skip to content

Instantly share code, notes, and snippets.

@lukasfarina
Created February 22, 2016 17:22
Show Gist options
  • Save lukasfarina/7c54cb1bcee74feddd8c to your computer and use it in GitHub Desktop.
Save lukasfarina/7c54cb1bcee74feddd8c to your computer and use it in GitHub Desktop.
Strip HTML tags from string in PHP
<?php
ob_start();
the_content();
$old_content = ob_get_clean();
$new_content = strip_tags($old_content);
$content_excerpt = substr($new_content, 0 ,130).'...';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment