You are here

function startsWith in Entity Reference Hierarchy 8

Helper functions for strings to determine if a string starts or ends with a substring.

File

./entity_hierarchy.module, line 358
A module to make nodes hierarchical.

Code

function startsWith($haystack, $needle) {

  // search backwards starting from haystack length characters from the end
  return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
}