Get all Post Content without Images in WordPress

When all post content except the images is needed for a section of a post/page layout, like a post summary or a custom post type, the method below strips all images from the post content. This works well when combined with either code from the previous two posts e33.io/112 and e33.io/123 to make unique layouts as needed.

<?php
function evo_post_without_images() {
	global $post;
	$content = get_the_content();
	$content = preg_replace( '/<img[^>]+\>/i', ' ', $content );
	$content = apply_filters( 'the_content', $content );
	$content = str_replace( ']]>', ']]>', $content );
	echo $content;
}

Use the function in the loop like this.

<?php evo_post_without_images(); ?>

If only the post excerpt is needed instead of the full content, the method below displays the WordPress standard 55 words of the post with HTML tags stripped out.

<?php echo wp_strip_all_tags( get_the_excerpt() ); ?>