Write your own array_column () function that is less than PHP 5.5, 5.5array_column
Array_column is used to get elements from a two-dimensional array (PHP 5.5 new), but we sometimes need to use it in a low-version PHP environment ...
if (! function_exists (' Array_column ')) {function Array_column ($input, $columnKey, $indexKey = NULL) {$columnKeyIsNum ber = (Is_numeric ($columnKey))? True:false; $indexKeyIsNull = (Is_null ($indexKey))? True:false; $indexKeyIsNumber = (Is_numeric ($indexKey))? True:false; $result = Array (); foreach (array) $input as $key + = $row) {if ($columnKeyIsNumber) {$tmp = Array_slice ($row, $colu Mnkey, 1); $tmp = (Is_array ($tmp) &&!empty ($tmp))? Current ($tmp): NULL; } else {$tmp = Isset ($row [$columnKey])? $row [$columnKey]: NULL; if (! $indexKeyIsNull) {if ($indexKeyIsNumber) {$key = Array_slice ($row, $indexKey, 1); $key = (Is_array ($key) &&! empty ($key))? Current ($key): NULL; $key = Is_null ($key)? 0: $key; } else {$key = Isset ($row [$indexKey])? $row [$indexKey]: 0; }} $result [$key] =$tmp; } return $result; }}
What is the current Apache version? can be compatible with php536 and MySQL 55117
Below is an online look for installation procedures, specifically I have not been configured under Apache,
If you do not want trouble can be the next ready-made components, such as Phpnow, integrated apache+php+mysql+zend optimizer+eaccelerator need to be configured to integrate all, install it.
2003, of course.
How is CMS system compatible with each version of PHP (40 or 50) servers?
To be able to run both on PHP4 and on php5, you need to have a version-judged function
You can do this:
if (Version_compare (Phpversion (), ' 5 ', ' < '))
Include_once (' php4.php ');//php4 related configuration file or calling function
Else
Include_once (' php5.php ');//php5 related file or call function
}
This way, in different environments, you can invoke different files to implement your functionality, but the specifics are much more complex to implement.
Hope to help you
http://www.bkjia.com/PHPjc/899062.html www.bkjia.com true http://www.bkjia.com/PHPjc/899062.html techarticle Write your own array_column () function that is less than PHP 5.5, 5.5array_column array_column is used to get the elements in a two-dimensional array (PHP 5.5 new function), but we sometimes need to be in the low ...