Same name and namespace in other branches
  1. 8.x-2.x src/ExifPHPExtension.php \Drupal\exif\ExifPHPExtension::startswith() 1 comment

Helper function to know if a substring start a string.

Used internally and in help page (so should be public).

Parameters

string $hay: The string where we look for.

string $needle: The string to look for.

Return value

bool if condition is valid.

1 call to ExifPHPExtension::startswith()
ExifPHPExtension::reformat in src/ExifPHPExtension.php
Helper function to reformat fields where required.

File

src/ExifPHPExtension.php, line 514

Class

ExifPHPExtension
Class ExifPHPExtension Parser implementation base d on PHP Exif extension.

Namespace

Drupal\exif

Code

public function startswith($hay, $needle) {
    return substr($hay, 0, strlen($needle)) === $needle;
}