MagpieRSS MagpieRSS(
string
$source, [string
$output_encoding = 'ISO-8859-1'], [string
$input_encoding = null], [bool
$detect_encoding = true]
)
|
|
Set up XML parser, parse source, and return populated RSS object..
Parameters:
|
string |
$source: |
string containing the RSS to be parsed NOTE: Probably a good idea to leave the encoding options alone unless you know what you're doing as PHP's character set support is a little weird. NOTE: A lot of this is unnecessary but harmless with PHP5 |
|
string |
$output_encoding: |
output the parsed RSS in this character set defaults to ISO-8859-1 as this is PHP's default. NOTE: might be changed to UTF-8 in future versions. |
|
string |
$input_encoding: |
the character set of the incoming RSS source. Leave blank and Magpie will try to figure it out. |
|
bool |
$detect_encoding: |
if false Magpie won't attempt to detect source encoding. (caveat emptor) |
void append(
$el,
$text
)
|
|
Parameters:
void append_content(
$text
)
|
|
Parameters:
void concat(
&$str1, [
$str2 = ""]
)
|
|
Parameters:
void create_parser(
$source,
$out_enc,
$in_enc,
$detect
)
|
|
return XML parser, and possibly re-encoded source
Parameters:
|
|
$source: |
|
|
|
$out_enc: |
|
|
|
$in_enc: |
|
|
|
$detect: |
|
void error(
$errormsg, [
$lvl = E_USER_WARNING]
)
|
|
Parameters:
void feed_cdata(
$p,
$text
)
|
|
Parameters:
void feed_end_element(
$p,
$el
)
|
|
Parameters:
void feed_start_element(
$p,
$element,
&$attrs
)
|
|
Parameters:
void known_encoding(
$enc
)
|
|
Parameters:
void php4_create_parser(
$source,
$in_enc,
$detect
)
|
|
Instaniate an XML parser under PHP4
Unfortunately PHP4's support for character encodings and especially XML and character encodings sucks. As long as the documents you parse only contain characters from the ISO-8859-1 character set (a superset of ASCII, and a subset of UTF-8) you're fine. However once you step out of that comfy little world things get mad, bad, and dangerous to know.
The following code is based on SJM's work with FoF
Parameters:
|
|
$source: |
|
|
|
$in_enc: |
|
|
|
$detect: |
|
API Tags:
void php5_create_parser(
$in_enc,
$detect
)
|
|
Instantiate an XML parser under PHP5
PHP5 will do a fine job of detecting input encoding if passed an empty string as the encoding.
All hail libxml2!
Parameters: