title: Why is array_rand() working with two elements but not more, or less than that?
body: <p>I'm randomly trying to select a text string from an array. I have a single dimension array with the same kind of structure as the following:</p>
  
  <pre><code>$jokes = array("Why is Peter Pan always flying? He neverlands." ,
                  "My girlfriend yelled at me today saying, \"You weren't even listening just now, were you?! I thought, \"Man, what a weird way to start a conversation.\"", 
                  "I used to have a job collecting leaves. I was raking it in.",
                  "What's the leading cause of dry skin? Towels.",
                  "I tell you what often gets overlooked - garden fences.",
                  "I wear a stethoscope so that in a medical emergency I can teach people a valuable lesson about assumptions.",
                  "Toasters were the first form of pop-up notifications.",
                  "I love sniffing my F1 key... don't worry though, I'm trying to get help.",
                  "I just ate a frozen apple. Hardcore.",
                  "RIP boiled water. You will be mist.",
                  "Archaeology really is a career in ruins...",
                  "You know what they say about cliffhangers...",
                  "I went out with a girl called Simile, I don't know what I metaphor.",
                  "My server sings, it's a Dell.");
  </code></pre>
  
  <p>And I'm selecting items from it using:</p>
  
  <pre><code>echo json_encode($jokes[array_rand($jokes, count($jokes)-1)]);
  </code></pre>
  
  <p>If I only have two items in the array then it randomizes perfectly however as soon as I go over or under  that number nothing returns.</p>