function _explode_to_int in Shadowbox 6.3
Same name and namespace in other branches
- 5.2 shadowbox.module \_explode_to_int()
- 5 shadowbox.module \_explode_to_int()
- 6.4 shadowbox.module \_explode_to_int()
- 6 shadowbox.module \_explode_to_int()
- 6.2 shadowbox.module \_explode_to_int()
- 7.4 shadowbox.admin.inc \_explode_to_int()
- 7.3 shadowbox.admin.inc \_explode_to_int()
Convert numerical value(s) within a delimited string to integer(s).
Explode a space delimited string e.g. 'a b 2' and cast numeric string values to integers.
Parameters
$string: A space delimited string.
Return value
An array containing strings and integers.
File
- ./
shadowbox.module, line 609 - Shadowbox, a JavaScript media viewer application for displaying content in a modal dialogue.
Code
function _explode_to_int($string) {
foreach (explode(' ', $string) as $value) {
$output[] = is_numeric($value) ? (int) $value : $value;
}
return $output;
}