Last active
August 9, 2016 16:37
-
-
Save sybrew/c654ebe5d0799e5b39cb407443df6775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts array to make a compatible list for both PHP5 and PHP7. | |
* | |
* @param array $array The array to convert. | |
* @return array $list in correct order to use PHPFUNCTION list(). | |
*/ | |
function prepare_list( array $array = array() ) { | |
if ( PHP_VERSION_ID >= 70000 ) | |
$array = array_reverse( $array ); | |
return $array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment