title: Get 2 words in every array value
body: <p>I have code like this one </p>
  
  <pre><code>$words2= 'If you want to have a preformatted block within a list, indent by eight spaces.';
  
  $forbiddenwords=array("word1","word2");
  
  foreach($words2 as $b=&gt;$v)
  {
      if(in_array($v, $forbidden) ){
      unset($words2[$b] );
  
      }
  }
  
  $words2 = array_values($words2);
  
  $words2=implode(' ',$words2);
  
  $words2 = implode(' ',array_chunk(mb_split('\s', $words2), 2));
  
  echo "&lt;pre&gt;";
  print_r($words2);
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>What I want is to create an array that every value of it contain 2 words from the string. The code above doesn't work -implode() not working with associative arrays- also the result that I'm trying to have is like that</p>
  
  <pre><code>array (
  $words2[0]=&gt;'If you'
  $words2[1]=&gt;'you want'
  $words2[1]=&gt;'want to'
  ...
  )
  </code></pre>