Function __global->is_location_within

Definitions

sources/locations.php

  • Determine if a given country or region ISO code is within the given country/region ISO conditions.A country location passes if any country conditions match; it ignores region conditions.A region location passes if any country conditions are in the same country, or any region conditions match.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$_location ?ID_TEXT No No required parameter N/A N/A The country or region ISO code to check (null: use the region of the member)
$conditions array No No required parameter N/A N/A Array of country and region ISO codes which result in a pass for this check

Returns

  • Whether the location is within any of the given conditions
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Determine if a given country or region ISO code is within the given country/region ISO conditions.A country location passes if any country conditions match; it ignores region conditions.A region location passes if any country conditions are in the same country, or any region conditions match.
 *
 * @param  ?ID_TEXT $_location The country or region ISO code to check (null: use the region of the member)
 * @param  array $conditions Array of country and region ISO codes which result in a pass for this check
 * @return boolean Whether the location is within any of the given conditions
 */

function is_location_within(?string $_location, array $conditions) : bool