You are here

public function GlossaryHelper::isAlpha in Search API AZ Glossary 8.4

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

Detect Alpha.

Parameters

string $first_letter: First Letter for the Glossary.

Return value

bool is it Alpha?

2 calls to GlossaryHelper::isAlpha()
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 115

Class

GlossaryHelper
Search Api Glossary AZ Helper class.

Namespace

Drupal\search_api_glossary\Service

Code

public function isAlpha($first_letter) {

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