SHARE
TWEET

Untitled

a guest Feb 14th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $result = [];
  2. $inBlock = false;
  3. $block = [];
  4. foreach ($array as $current) {
  5.     if ($inBlock) {
  6.         $valid = false;
  7.         foreach ($payloads as $payload) {
  8.             if (strpos($current, $payload) === 0) {
  9.                 $valid = true;
  10.             }
  11.         }
  12.  
  13.         if ($valid) {
  14.             $block[] = $current;
  15.         } elseif ($current === $end) {
  16.             $result = array_merge($result, $block, ['|']);
  17.         }
  18.  
  19.         $inBlock = $valid;
  20.     } elseif (strpos($current, $start) === 0) {
  21.         $block = [$current];
  22.         $inBlock = true;
  23.     }
  24. }
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