Tag Archives | compatibility
Function sys_getloadavg in PHP < 5.1.3

Function sys_getloadavg in PHP < 5.1.3

According to the document of PHP official website, http://php.net/sys_getloadavg sys_getloadavg (PHP 5 >= 5.1.3) sys_getloadavg — Gets system load average So, it’s only for PHP >= 5.1.3. In PHP < 5.1.3, we use this function below: <?php if (!function_exists(‘sys_getloadavg’)) { function sys_getloadavg() { if (@is_readable(‘/proc/loadavg’)) { //Linux if ($fh = @fopen(‘/proc/loadavg’, ‘r’)) { $data = […]

Read full story Comments { 1 }
Function str_ireplace in PHP4

Function str_ireplace in PHP4

According to the document of PHP official website, http://php.net/str_ireplace str_ireplace (PHP 5) str_ireplace — Case-insensitive version of str_replace(). So, it’s only for PHP5+. In PHP4, we use this function below: Example 1: result: array(3) { [0]=> string(29) “If find and change are arrays” [1]=> string(92) “then str_ichange() takes a value from each array and uses […]

Read full story Comments { 0 }
Function stripos in PHP4

Function stripos in PHP4

According to the document of PHP official website, http://php.net/stripos stripos (PHP 5) stripos — Find the position of the first occurrence of a case-insensitive substring in a string So, it’s only for PHP5+. In PHP4, we use this function below:

Read full story Comments { 0 }
Function http_build_query in PHP4

Function http_build_query in PHP4

According to the document of PHP official website, http://php.net/http_build_query http_build_query (PHP 5) http_build_query — Generate URL-encoded query string So, it’s only for PHP5+. In PHP4, we use this function below:

Read full story Comments { 0 }
Function str_split in PHP4

Function str_split in PHP4

According to the document of PHP official website, http://php.net/manual/en/function.str-split.php str_split (PHP 5) str_split — Convert a string to an array

Read full story Comments { 0 }