Pear's PHP_Compat is an interesting package. It provides some php5-specific functions that can also be used under php4, such as file_put_contents, array_combine, str_split... In this way, even on a php4 host, You can enjoy a little convenience of php5 functions in advance.
Usage
PLAIN TEXT
PHP:
<?php
require_once'PHP/Compat.php';
// load file_put_contents
PHP_Compat::loadFunction('file_put_contents');
// load str_split, array_chunk and file_get_contents
PHP_Compat::loadFunction(array('str_split','array_chunk','file_get_contents'));
?>
The above example shows that n php5-specific functions can be loaded at one time.
Package Information: PHP_Compat
http://pear.php.net/package/PHP_Compat
Author: volcano Published on November 23, 2006 at 7:42 am
Copyright information: You can reprint at will. When reprinting, please be sure to indicate the original source and author information of the article in the form of a hyperlink. and
the permanent link to this statement - http://www.ooso.net/index.php/archives/267