Last active
August 29, 2015 14:16
-
-
Save twysto/a104cb91c9a06111b7f7 to your computer and use it in GitHub Desktop.
[PHP] String Array to Integers Array
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
function stringsArrayToIntegersArray($array) { | |
// Before : array("1", "2", "3"); | |
$array = array_map( | |
create_function('$value', 'return (int)$value;'), | |
$array | |
); | |
// After : array(1, 2, 3); | |
return $array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment