Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.26 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Can't flatten multidimensional array with lots of duplicates
  2. $inputString = 'a??';
  3. $array = array();
  4.  
  5. if (strpos($inputString, 'a') !== false && !in_array($inputString, $array)) {
  6.    $array[] = $inputString;
  7. }
  8.  
  9. echo '<pre>'; print_r($array); echo '</pre>';