本文整理匯總了PHP中text::html2txt方法的典型用法代碼示例。如果您正苦於以下問題:PHP text::html2txt方法的具體用法?PHP text::html2txt怎麽用?PHP text::html2txt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類text
的用法示例。
在下文中一共展示了text::html2txt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _get_theme_data
/**
* Parse the styles.css file for Meta-Data
*/
private function _get_theme_data($theme_file)
{
$theme_data = implode('', file($theme_file));
$theme_data = str_replace('\\r', '\\n', $theme_data);
if (preg_match('|' . Kohana::lang('ui_admin.theme_name') . ':(.*)$|mi', $theme_data, $theme_name)) {
$name = $theme = trim(text::html2txt($theme_name[1]));
} else {
$name = $theme = '';
}
if (preg_match('|' . Kohana::lang('ui_admin.description') . ':(.*)$|mi', $theme_data, $description)) {
$description = trim(text::html2txt($description[1]));
} else {
$description = '';
}
if (preg_match('|' . Kohana::lang('ui_admin.demo') . ':(.*)$|mi', $theme_data, $demo_url)) {
$demo_url = trim(text::html2txt($demo_url[1]));
} else {
$demo_url = '';
}
if (preg_match('|' . Kohana::lang('ui_admin.version') . ':(.*)|i', $theme_data, $version)) {
$version = trim(text::html2txt($version[1]));
} else {
$version = '';
}
if (preg_match('|' . Kohana::lang('ui_admin.author') . ':(.*)|i', $theme_data, $author)) {
$author = trim(text::html2txt($author[1]));
} else {
$author = Kohana::lang('ui_admin.anonymous');
}
if (preg_match('|' . Kohana::lang('ui_admin.author_email') . ':(.*)|i', $theme_data, $author_email)) {
$author_email = trim(text::html2txt($author_email[1]));
} else {
$author_email = '';
}
return array('Name' => $name, 'Title' => $theme, 'Description' => $description, 'Demo' => $demo_url, 'Version' => $version, 'Author' => $author, 'Author_Email' => $author_email);
}
示例2: _get_theme_data
/**
* Parse the styles.css file for Meta-Data
*/
private function _get_theme_data($theme_file)
{
$theme_data = implode('', file($theme_file));
$theme_data = str_replace('\\r', '\\n', $theme_data);
if (preg_match('|Theme Name:(.*)$|mi', $theme_data, $theme_name)) {
$name = $theme = trim(text::html2txt($theme_name[1]));
} else {
$name = $theme = '';
}
if (preg_match('|Description:(.*)$|mi', $theme_data, $description)) {
$description = trim(text::html2txt($description[1]));
} else {
$description = '';
}
if (preg_match('|Demo:(.*)$|mi', $theme_data, $demo_url)) {
$demo_url = trim(text::html2txt($demo_url[1]));
} else {
$demo_url = '';
}
if (preg_match('|Version:(.*)|i', $theme_data, $version)) {
$version = trim(text::html2txt($version[1]));
} else {
$version = '';
}
if (preg_match('|Author:(.*)|i', $theme_data, $author)) {
$author = trim(text::html2txt($author[1]));
} else {
$author = 'Anonymous';
}
if (preg_match('|Author Email:(.*)|i', $theme_data, $author_email)) {
$author_email = trim(text::html2txt($author_email[1]));
} else {
$author_email = '';
}
return array('Name' => $name, 'Title' => $theme, 'Description' => $description, 'Demo' => $demo_url, 'Version' => $version, 'Author' => $author, 'Author_Email' => $author_email);
}