summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorhorus2021-03-15 22:38:27 +0100
committerhorus2021-03-15 22:38:27 +0100
commit3ee4fc2d67dc3aecdb72ad39f23fb0ec3637cb08 (patch)
tree257476f6b031a7bf88a06a6690b8fecc5a6081ac /functions.php
parent83fec0b53ae04e23948b981cf845ce0d476ba22a (diff)
downloadmoehring-3ee4fc2d67dc3aecdb72ad39f23fb0ec3637cb08.tar.gz
Changes to trailing slash.
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 0b7d369..9bd65e4 100644
--- a/functions.php
+++ b/functions.php
@@ -15,3 +15,11 @@ function str_starts_with( $haystack, $needle ) {
$length = strlen( $needle );
return substr( $haystack, 0, $length ) === $needle;
}
+
+function str_ends_with( $haystack, $needle) {
+ $len = strlen($needle);
+ if ($len == 0) {
+ return true;
+ }
+ return substr($haystack, -$len) === $needle;
+}