Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Project.php

function Project::compareLength

Helper method to sort array values by string length with usort().

Parameters

string $a First string.:

string $b Second string.:

Return value

int

File

vendor/drupal/coder/coder_sniffer/DrupalPractice/Project.php, line 234

Class

Project
Helper class to retrieve project information like module/theme name for a file.

Namespace

DrupalPractice

Code

public static function compareLength($a, $b) {
    return strlen($a) - strlen($b);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal