Codeigniter XML Helper â Codeigniter XML Helper contains function that is used to Convert String As a input to XML Characters.$this->load->helper(âxmlâ); is used to load the helper. Here in this tutorial, we are going to explain how to use XML helper in CodeIgniter.
Codeigniter XML Helper Example
Let us first see how to load XML helper in codeigniter and then use its function-
Load XML Helper
How To Load XML Helper in Codeingniter Example:
$this->load->helper('xml'); |
Functions:-
Following function is available in codeigniter let us understand with example.
- XML-converted string
- $str (string) : the text string to convert
- $protect_all (bool) : Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo;
- Returns : XML-converted string
- Return type : string
Syntax of XML-converted string function is
Syntax of XML-converted string function is:-
xml_convert($str[$protect_all = FALSE]) |
Parameters:
EXAMPLE
Here is simple example of XML-converted string.
XML-converted string in Codeigniter Example:-
//Controllers part public function xmlCheck() { $this->load->helper('xml'); $this->load->view('xml_view'); } // Views parts <?php $string = '<p?>Hi This is Solid Coupon ({).'; $string = xml_convert($string); echo $string; ?> |
This Helper Convert String As a Input To XML Characters
The output will be like this â