当前位置: 首页>>代码示例>>PHP>>正文


PHP text::html2txt方法代码示例

本文整理汇总了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);
 }
开发者ID:kh411d,项目名称:Ushahidi_Web,代码行数:39,代码来源:themes.php

示例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);
 }
开发者ID:kiirti,项目名称:Ushahidi_MHI,代码行数:39,代码来源:themes.php


注:本文中的text::html2txt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。