public function getHtmlById($post, $id)
{
$content = $post['BlogPost']['content'] . $post['BlogPost']['detail'];
$values = array();
$pattern = '/<([^\\s]+)\\s[^>]*?id="' . $id . '"[^>]*>(.*?)<\\/\\1>/is';
if (preg_match($pattern, $content, $matches)) {
return $matches[2];
} else {
return '';
}
}