Properties (public variables)
- Folder in which cached data should be stored. Remember to chmod this folder to 777. Set $cache_dir to "" (empty string) to disable transparent cache.
- Cache interval in seconds. Don't set this lower than 1200 (20 minutes) - webmasters will hate you otherwise. Optimal value is between 3600 and 14400 (1 - 4 hours) in my opinion.
- Code page - all text data will be converted to this character encoding. See Lib Iconv for supported encodings. To disable encoding conversion just don't set
$lastRSS->cp or set it to "" (empty string). Note: PHP 4.0.5 or higher required.
- Default document codepage in case of missing codepage definition in RSS. By default it is = 'UTF-8'.
- Allows limit number of returned items. 0 (zero) means "no limit" and it's also the dafault value.
- All pubDate and lastBuildDate data will be converted to specified date/time format. The format is fully compatible with PHP function date(); see PHP manual: date() for details.
For example: If you need timestamp format instead of RFC, set
$date_format = 'U';
To disable date format conversion set date_format to empty string (default value).
stripHTML = True to strip HTML code from RSS content. Default value is
- Allows to set how to proceed CDATA information.
nochange = default value; don't make any changes (get CDATA content including CDATA tag)
strip = completely strip CDATA information
content = get CDATA content (without CDATA tag)
Methods (public functions)
- Load and parse RSS file
$rss_url (e.g. "http://www.freshfolder.com/rss.php"). It use cached version of file if cache is enabled and cached file is fresh enough. Returns associative array of RSS fields. Simply use print_r() function to see structure of the result (see Demo 1).