jargon

Roe Web Builder - Randomizer Glitch

Oct 16th, 2021
1,113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function randomizer( $page = '', $pattern = null, $inventory = array() )
  2. {
  3.     $nen = nen_ini();
  4.    
  5.     if( is_null ( $pattern ) )
  6.     {
  7.         return $inventory;
  8.     }
  9.    
  10.     echo '<div style="font-size:12px;">'. str_replace( '\r\n', '<br>', htmlentities( $page ) ). '</div>';
  11.    
  12.     if( preg_match_all( $pattern, $page, $matches ) )
  13.     {
  14.         echo '<div style="font-size:24px;">'. $pattern. '</div>';
  15.  
  16.         var_dump( $matches );
  17.         foreach( $matches as $groups )
  18.         {
  19.             $option_index = 0;
  20.             while( isset( $groups[ 'option'. ( $option_index + 1 ) ] ) )
  21.             {
  22.                 $option_index++;
  23.                 $inventory[ count( $inventory ) ] = $groups[ 'option'. ( $option_index ) ];
  24.             }
  25.         }
  26.     }
  27.     return $inventory;
  28. }
RAW Paste Data