Package DE_EPAGES::Core::API::String
Functions
- DecodeStructure
- EncodeNonISO1Chars
- EncodeStructure
- QuoteTags
- QuoteXML
- UnquoteXML
DecodeStructure
Decodes all strings in a nestes array/hash structure with a given
character encoding. The function creates a copy of the structure. The
original structure is not changed.
Syntax |
$Structure = DecodeStructure( $Encoding, $EncodedStructure )
|
Example |
$Structure = DecodeStructure( 'iso-8859-1', $EncodedStructure );
|
Input |
- $Encoding (string)
- character encoding, example: 'iso-8859-1'
- $EncodedStructure (ref)
- the structure with encoded strings
|
Return |
- $Structure (ref)
- a tree structure of arrays and/or hashes
|
EncodeNonISO1Chars
Syntax |
$Output = EncodeNonISO1Chars( $Input );
|
Example |
"&
|
EncodeStructure
Encodes all strings in a nestes array/hash structure with a given
character encoding. The function creates a copy of the structure. The
original structure is not changed.
Syntax |
$EncodedStructure = EncodeStructure( $Encoding, $Structure )
|
Example |
$EncodedStructure = EncodeStructure( 'iso-8859-1', \%Structure );
|
Input |
- $Encoding (string)
- character encoding, example: 'iso-8859-1'
- $Structure (ref)
- a tree structure of arrays and/or hashes
|
Return |
- $EncodedStructure (ref)
- the structure with encoded strings
|
QuoteTags
Replaces the special characters <and> by < and > respectively.
Syntax |
$Output = QuoteTags( $Input );
|
Example |
print QuoteTags( "<bigger>&</bigger>" );
|
Input |
- $Input (string)
- input string
|
Return |
- $Output (string)
- output string
|
QuoteXML
Replaces the special characters &"'<> by their corresponding XML entities.
Syntax |
$Output = QuoteXML( $Input );
|
Example |
print QuoteXML( "<bigger>&</bigger>" );
|
Input |
- $Input (string)
- input string
|
Return |
- $Output (string)
- output string
|
UnquoteXML
Replaces standard XML entities by the corresponding special characters.
Syntax |
$Output = UnquoteXML( $Input );
|
Input |
- $Input (string)
- input string
|
Return |
- $Output (string)
- output string
|