You are here

function _explode_to_int in Shadowbox 6

Same name and namespace in other branches
  1. 5.2 shadowbox.module \_explode_to_int()
  2. 5 shadowbox.module \_explode_to_int()
  3. 6.4 shadowbox.module \_explode_to_int()
  4. 6.2 shadowbox.module \_explode_to_int()
  5. 6.3 shadowbox.module \_explode_to_int()
  6. 7.4 shadowbox.admin.inc \_explode_to_int()
  7. 7.3 shadowbox.admin.inc \_explode_to_int()

Convert numerical value(s) within a delimited string to integer(s).

Explode a delimted string e.g. 'a b 2' or 'a,b,2' and type cast numeric string values to int.

Parameters

$string: A delimited string containing a numerical value.

$delimiter: The boundary string by which to explode.

Return value

An array containing strings and integrers.

1 call to _explode_to_int()
shadowbox_header in ./shadowbox.module
Build the Shadowbox header by adding the necessary CSS and JS files.

File

./shadowbox.module, line 614
Shadowbox, a JavaScript media viewer application for displaying content in a modal dialog.

Code

function _explode_to_int($string, $delimiter) {
  foreach (explode($delimiter, $string) as $value) {
    is_numeric($value) ? $output[] = (int) $value : ($output[] = $value);
  }
  return $output;
}