You are here

public function GlossaryHelper::isNumeric in Search API AZ Glossary 8.3

Same name and namespace in other branches
  1. 8.4 src/Service/GlossaryHelper.php \Drupal\search_api_glossary\Service\GlossaryHelper::isNumeric()

Detect Numeric.

Parameters

string $first_letter: First Letter for the Glossary.

Return value

bool is it Numeric?

2 calls to GlossaryHelper::isNumeric()
GlossaryHelper::glossaryGroupName in src/Service/GlossaryHelper.php
Helper for Alpha Numeric Keys.
GlossaryHelper::isSpecial in src/Service/GlossaryHelper.php
Detect non Alpha Numeric.

File

src/Service/GlossaryHelper.php, line 133

Class

GlossaryHelper
Search Api Glossary AZ Helper class.

Namespace

Drupal\search_api_glossary\Service

Code

public function isNumeric($first_letter) {

  // Is it a number?
  // See http://php.net/manual/en/regexp.reference.unicode.php
  if (preg_match('/^\\p{N}+$/u', $first_letter)) {
    return TRUE;
  }
  return FALSE;
}