SHARE
TWEET

Untitled

a guest Feb 14th, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $result = [];
  2. $inBlock = false;
  3. $block = [];
  4. for ($i = 0; $i < count($array); $i++) {
  5.     $current = $array[$i];
  6.     if ($inBlock) {
  7.         $valid = false;
  8.         foreach ($payloads as $payload) {
  9.             if (strpos($current, $payload) === 0) {
  10.                 $valid = true;
  11.             }
  12.         }
  13.  
  14.         if ($valid) {
  15.             $block[] = $current;
  16.         } elseif ($current === $end) {
  17.             $result = array_merge($result, $block, ['|']);
  18.         }
  19.  
  20.         $inBlock = $valid;
  21.     } elseif (strpos($current, $start) === 0) {
  22.         $block = [$current];
  23.         $inBlock = true;
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top