title: How do i unset duplicate string in a str_split string line
body: <p>How do i check if same string occurs twice or multiples times and remove it. Example the split string is <strong>123 456 123 789</strong>, I want to be able to unset the repeated character in the split string line 
  example my expected output should be like <strong>web123 web456 web789</strong>. Here is what I tried:</p>
  
  <pre><code>&lt;?php
  
  $str = "jmja12345jmja612378911";
  $int = filter_var($str, FILTER_SANITIZE_NUMBER_INT);
  $disp = str_split($int, 3);
  foreach($disp as $char){
      if(strlen($char) == "3") 
      {
          $net = substr($char,1,2);
          if(preg_match('/(50|30)/i', $net))
          {
              echo "our computer can not edit $net";
              exit();
          }
          else
          {
              $pd = str_replace("$net","web$net",$net);
              $str = implode(array_unique(explode( $pd)));
              echo $str;
          }
      }
  }
  </code></pre>
  
  <p>But I get no good result. What am I doing wrong? view at <a href="https://ideone.com/fork/rGyH41" rel="nofollow noreferrer">https://ideone.com/fork/rGyH41</a></p>