aboutsummaryrefslogtreecommitdiff
path: root/fn/fn.php
diff options
context:
space:
mode:
Diffstat (limited to 'fn/fn.php')
-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;
+
+}
+
?>