You are here

function blogapi_blogger_get_title in Blog API 8

Helper function to extract title.

Parameters

$string: The input string.

Return value

string The returned title.

2 calls to blogapi_blogger_get_title()
blogapi_blogger_edit_post in modules/blogapi_blogger/blogapi_blogger.module
Callback for blogger.editPost.
blogapi_blogger_new_post in modules/blogapi_blogger/blogapi_blogger.module
Callback for blogger.newPost.

File

modules/blogapi_blogger/blogapi_blogger.module, line 268

Code

function blogapi_blogger_get_title($string) {
  if (preg_match('/<title>(.*?)<\\/title>/i', $string, $title)) {
    return strip_tags($title[0]);
  }
  return '';
}