title: PHP select random strings from given strings
body: <p>sorry I am new to PHP. I would like my code to randomly select from these:
  '/post371/',
  '/post375/',
  '/post377/',</p>
  <p>but when I tried to access my url it redirects to <a href="https://example.com0" rel="nofollow noreferrer">https://example.com0</a> , <a href="https://example.com1" rel="nofollow noreferrer">https://example.com1</a>, <a href="https://example.com2" rel="nofollow noreferrer">https://example.com2</a>.</p>
  <p>Instead of, <a href="https://example.com/post371/" rel="nofollow noreferrer">https://example.com/post371/</a> , <a href="https://example.com/post375/" rel="nofollow noreferrer">https://example.com/post375/</a> , <a href="https://example.com/post377/" rel="nofollow noreferrer">https://example.com/post377/</a></p>
  <p>Here's my code:</p>
  <pre><code>&lt;?php        
  $pagez = array(
          '/post371/',
          '/post375/',
          '/post377/',
      );
      
      if(empty($_GET['redir'])) {
          $_GET['redir'] = base64_encode(home_url() . array_rand($pagez));
      }
  ?&gt;
  
  
      &lt;form id=&quot;landing&quot; method=&quot;POST&quot; action=&quot;&lt;?php echo base64_decode($_GET['redir']); ?&gt;&quot;&gt;
          &lt;input type=&quot;hidden&quot; name=&quot;newwpsafelink&quot; value=&quot;&lt;?php echo $_GET['code'] ?&gt;&quot;&gt;
      &lt;/form&gt;
      &lt;script&gt;
          window.onload = function() {
              document.getElementById('landing').submit();
          }
      &lt;/script&gt;
  </code></pre>
  <p>Thank You!</p>