aboutsummaryrefslogtreecommitdiff
path: root/fn
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-04-17 15:46:41 +0200
committervincent-peugnet <v.peugnet@free.fr>2018-04-17 15:46:41 +0200
commit5a6d7248fcbc3f88fe66f3b52d51087698c3e6ba (patch)
tree086d3542a0ec7c3b0e8aeb0ae5d62d7067409bb3 /fn
parent899a4bd60570ff9b77fabe89dd4902f09bbdeb47 (diff)
downloadwcms-5a6d7248fcbc3f88fe66f3b52d51087698c3e6ba.tar.gz
wcms-5a6d7248fcbc3f88fe66f3b52d51087698c3e6ba.zip
title intro lien
Diffstat (limited to 'fn')
-rw-r--r--fn/fn.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/fn/fn.php b/fn/fn.php
index 79007ef..b075d57 100644
--- a/fn/fn.php
+++ b/fn/fn.php
@@ -34,5 +34,23 @@ function head($title)
}
+function search($haystack, $debut, $fin)
+{
+ $list = [];
+
+ $indexdebut = strpos($haystack, $debut);
+ if ($indexdebut !== false) {
+ $indexdebut += strlen($debut);
+ $indexfin = strpos($haystack, $fin, $indexdebut);
+ if ($indexfin !== false) {
+ array_push($list, substr($haystack, $indexdebut, $indexfin - $indexdebut));
+ $haystack = substr($haystack, $indexfin);
+ $list = array_merge($list, search($haystack, $debut, $fin));
+ }
+ }
+ return $list;
+
+}
+
?>