SimplePie: PHP-based RSS and Atom feed handling
 
  • Overview
  • Demo
  • Blog
  • Download
  • Documentation
  • API Docs
  • Support
  • Issue Tracker
  • FAQ
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • SimplePie
    • API
    • Caching
    • HTTP
    • Parsing

Classes

  • SimplePie_Decode_HTML_Entities
  • SimplePie_Locator
  • SimplePie_Misc
  • SimplePie_Registry
  • SimplePie_Sanitize

Class SimplePie_Misc

Miscellanous utilities

Package: SimplePie
Copyright: 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
License: BSD License
Author: Ryan Parman
Author: Geoffrey Sneddon
Author: Ryan McCue
Located at SimplePie/Misc.php
Methods summary
public static
# time_hms( $seconds )
public static
# absolutize_url( $relative, $base )
public static array
# get_element( string $realname, string $string )

Get a HTML/XML element from a HTML string

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
public static
# element_implode( $element )
public static
# error( $message, $level, $file, $line )
public static
# fix_protocol( $url, $http = 1 )
public static
# parse_url( $url )
public static
# compress_parse_url( $scheme = '', $authority = '', $path = '', $query = '', $fragment = '' )
public static
# normalize_url( $url )
public static
# percent_encoding_normalization( $match )
public static string
# windows_1252_to_utf8( string $string )

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

Parameters

$string
string
Windows-1252 encoded string

Returns

string
UTF-8 encoded string
public static string|boolean
# change_encoding( string $data, string $input, string $output )

Change a string from one encoding to another

Parameters

$data
string
Raw data in $input encoding
$input
string
Encoding of $data
$output
string
Encoding you want

Returns

string|boolean
False if we can't convert it
protected static
# change_encoding_mbstring( $data, $input, $output )
protected static
# change_encoding_iconv( $data, $input, $output )
public static string
# encoding( string $charset )

Normalize an encoding name

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

string
Standardised name
public static
# get_curl_version( )
public static string
# strip_comments( string $data )

Strip HTML comments

Parameters

$data
string
Data to strip comments from

Returns

string
Comment stripped string
public static
# parse_date( $dt )
public static string
# entities_decode( string $data )

Decode HTML entities

Deprecated

Use DOMDocument instead

Parameters

$data
string
Input data

Returns

string
Output data
public static string
# uncomment_rfc822( string $string )

Remove RFC822 comments

Parameters

$string
string
$data Data to strip comments from

Returns

string
Comment stripped string
public static
# parse_mime( $mime )
public static
# atom_03_construct_type( $attribs )
public static
# atom_10_construct_type( $attribs )
public static
# atom_10_content_construct_type( $attribs )
public static
# is_isegment_nz_nc( $string )
public static
# space_seperated_tokens( $string )
public static string
# codepoint_to_utf8( integer $codepoint )

Converts a unicode codepoint to a UTF-8 character

Parameters

$codepoint
integer
Unicode codepoint

Returns

string
UTF-8 character
public static array
# parse_str( string $str )

Similar to parse_str()

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

Parameters

$str
string
The input string.

Returns

array
public static array
# xml_encoding( string $data, SimplePie_Registry $registry )

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

Parameters

$data
string
XML data
$registry
SimplePie_Registry
Class registry

Returns

array
Possible encodings
public static
# output_javascript( )
public static
# get_build( )

Get the SimplePie build timestamp

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

public static
# debug( & $sp )

Format debugging information

public static
# silence_errors( $num, $str )

Show some love! Wishlists for Geoffrey, Ryan P., and Ryan M.

SimplePie is © 2004–2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue and contributors. Licensed under the BSD License. Hosted thanks to Matt Mullenweg, API documentation generated by ApiGen 2.6.1. Variation on the Feed Icon by Wolfgang Bartelme.