mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 21:17:16 +02:00
added a contains() static method
This commit is contained in:
@@ -28,6 +28,16 @@ abstract class Utils
|
||||
return $needle === '' || substr($haystack, -strlen($needle)) === $needle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $haystack
|
||||
* @param string $needle
|
||||
* @return bool
|
||||
*/
|
||||
public static function contains($haystack, $needle)
|
||||
{
|
||||
return $needle === '' || strpos($haystack, $needle) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge two objects into one.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user