Escape Class WordPress

/* If you want to explicitly style a post, you can use the sanitized 
 * version of the post title as a class
 */
$post_class = sanitize_html_class( $post->post_title );
echo '<div class="' . $post_class . '">';
Strange Squirrel