本文整理汇总了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);
}