You are here

function globallink_starts_with in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_starts_with()
  2. 7.6 globallink.inc \globallink_starts_with()

Determines whether or not a string begins with a certain substring.

Parameters

string $haystack: The haystack.

string $needle: The needle.

Return value

int @see strncmp()

1 call to globallink_starts_with()
globallink_field in ./globallink_field_configuration.inc
Renders form for globallink_field.

File

./globallink.inc, line 948
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_starts_with($haystack, $needle) {
  return !strncmp($haystack, $needle, strlen($needle));
}