Miscellanous utilities

package SimplePie

 Methods

absolutize_url()

absolutize_url($relative, $base) 
Static

Parameters

$relative

$base

atom_03_construct_type()

atom_03_construct_type($attribs) 
Static

Parameters

$attribs

atom_10_construct_type()

atom_10_construct_type($attribs) 
Static

Parameters

$attribs

atom_10_content_construct_type()

atom_10_content_construct_type($attribs) 
Static

Parameters

$attribs

Change a string from one encoding to another

change_encoding(string $data, string $input, string $output) : string | boolean
Static

Parameters

$data

string

Raw data in $input encoding

$input

string

Encoding of $data

$output

string

Encoding you want

Returns

stringbooleanFalse if we can't convert it

Converts a unicode codepoint to a UTF-8 character

codepoint_to_utf8(integer $codepoint) : string
Static
static

Parameters

$codepoint

integer

Unicode codepoint

Returns

stringUTF-8 character

compress_parse_url()

compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = ''
Static

Parameters

$scheme

$authority

$path

$query

$fragment

Format debugging information

debug($sp) 
Static

Parameters

$sp

element_implode()

element_implode($element) 
Static

Parameters

$element

Normalize an encoding name

encoding(string $charset) : string
Static

This is automatically generated by create.php

To generate it, run php create.php on the command line, and copy the output to replace this function.

Parameters

$charset

string

Character set to standardise

Returns

stringStandardised name

Decode HTML entities

entities_decode(string $data) : string
Static
deprecated Use DOMDocument instead

Parameters

$data

string

Input data

Returns

stringOutput data

error()

error($message, $level, $file, $line) 
Static

Parameters

$message

$level

$file

$line

fix_protocol()

fix_protocol($url, $http = 1
Static

Parameters

$url

$http

Get the SimplePie build timestamp

get_build() 
Static

Uses the git index if it exists, otherwise uses the modification time of the newest file.

get_curl_version()

get_curl_version() 
Static

Get a HTML/XML element from a HTML string

get_element(string $realname, string $string) : array
Static
deprecated Use DOMDocument instead (parsing HTML with regex is bad!)

Parameters

$realname

string

Element name (including namespace prefix if applicable)

$string

string

HTML document

Returns

array

is_isegment_nz_nc()

is_isegment_nz_nc($string) 
Static

Parameters

$string

normalize_url()

normalize_url($url) 
Static

Parameters

$url

output_javascript()

output_javascript() 
Static

parse_date()

parse_date($dt) 
Static

Parameters

$dt

parse_mime()

parse_mime($mime) 
Static

Parameters

$mime

Similar to parse_str()

parse_str(string $str) : array
Static

Returns an associative array of name/value pairs, where the value is an array of values that have used the same name

static

Parameters

$str

string

The input string.

Returns

array

parse_url()

parse_url($url) 
Static

Parameters

$url

percent_encoding_normalization()

percent_encoding_normalization($match) 
Static

Parameters

$match

silence_errors()

silence_errors($num, $str) 
Static

Parameters

$num

$str

space_seperated_tokens()

space_seperated_tokens($string) 
Static

Parameters

$string

Strip HTML comments

strip_comments(string $data) : string
Static

Parameters

$data

string

Data to strip comments from

Returns

stringComment stripped string

time_hms()

time_hms($seconds) 
Static

Parameters

$seconds

Remove RFC822 comments

uncomment_rfc822($string) : string
Static

Parameters

$string

Returns

stringComment stripped string

Converts a Windows-1252 encoded string to a UTF-8 encoded string

windows_1252_to_utf8(string $string) : string
Static
static

Parameters

$string

string

Windows-1252 encoded string

Returns

stringUTF-8 encoded string

Detect XML encoding, as per XML 1.0 Appendix F.1

xml_encoding(string $data, \SimplePie_Registry $registry) : array
Static
todo Add support for EBCDIC

Parameters

$data

string

XML data

$registry

\SimplePie_Registry

Class registry

Returns

arrayPossible encodings

change_encoding_iconv()

change_encoding_iconv($data, $input, $output) 
Static

Parameters

$data

$input

$output

change_encoding_mbstring()

change_encoding_mbstring($data, $input, $output) 
Static

Parameters

$data

$input

$output