You are here

function prefix_length_from_map in ISBN Field 6

3 calls to prefix_length_from_map()
canonical_ISBN in ./isbn.inc
country_group_code in ./isbn.inc
is_assigned in ./isbn.inc

File

./isbn.inc, line 138

Code

function prefix_length_from_map($s, $map) {
  for ($i = 1; $i < sizeof($map); $i++) {
    if (strcmp($s, $map[$i]) < 0) {
      return strlen($map[$i - 1]);
    }
  }
  return strlen($map[$i - 1]);
}