目录 搜索
Array Array Helper Benchmarking Benchmarking Class Caching Caching Driver Calendaring Calendaring Class CAPTCHA CAPTCHA Helper Config Config Class Cookie Cookie Helper Database Connecting to your Database Custom Function Calls Database Caching Class Database Configuration Database Forge Class Database Metadata Database Quick Start: Example Code Database Reference Database Utility Class DB Driver Reference Generating Query Results Queries Query Builder Class Query Helper Methods Transactions Date Date Helper Directory Directory Helper Download Download Helper Email Email Class Email Helper Encrypt Encrypt Class Encryption Encryption Library File File Helper File Uploading File Uploading Class Form Form Helper Form Validation Form Validation FTP FTP Class Functions compatibility_functions common_functions HTML HTML Helper HTML Table HTML Table Class Image Manipulation Image Manipulation Class Inflector Inflector Helper Input Input Class Javascript Javascript Class Language Language Class Language Helper Loader Loader Class Migrations Migrations Class Number Number Helper Output Output Class Pagination Pagination Class Path Path Helper Security Security Class Security Helper Session Session Library Shopping Cart Shopping Cart Class Smiley Smiley Helper String String Helper Template Parser Template Parser Class Text Text Helper Trackback Trackback Class Typography Typography Class Typography Helper Unit Testing Unit Testing Class URI URL User Agent XML XML-RPC and XML-RPC Server Zip Encoding Zip Encoding Class XML-RPC and XML-RPC Server Classes XML Helper User Agent Class URL Helper URI Class
文字

XMLHelper文件包含有助于处理XML数据的函数。

  • 加载此助手

  • 可用职能

加载此助手

使用以下代码加载此助手

$this->load->helper('xml');

可用职能

现有下列职能:

xml_convert($str[, $protect_all = FALSE])

参数:

$ str(string) - 要转换的文本字符串$ protect_all(bool) - 是否保护看起来像潜在实体的所有内容,而不仅仅是编号实体,例如&foo;

返回:

XML转换的字符串

返回类型:

  • $ strstring) - 要转换的文本字符串

  • $ protect_allbool) - 是否保护看起来像潜在实体的所有内容而不仅仅是编号实体,例如&foo;

Returns:  XML-converted string
Return type:  string
将字符串作为输入并将以下保留的XML字符转换为实体:
  • 符号:&

  • 小于或大于字符:<>

  • 单引号和双引号:“

  • 破折号:-

该函数如果是现有编号字符实体的一部分,则忽略符号。{.例如:

$ string ='<p>这是一段&实体({)。</ p>'; $ string = xml_convert($ string); echo $ string;

产出:

<p>这是一段&实体({)。</ p>

上一篇: 下一篇: