fork(1) download
  1. <?php
  2.  
  3. $productList="
  4. Saluran Dua(Bothway)-(TAN007);
  5. Speedy Password-(INET PASS);
  6. Memo-(T-Memo);
  7. 7-pib r-10/10-(AM);
  8. FBI (R/N/M)-(Rr);
  9. ";
  10.  
  11. preg_match_all('(^(.*)-\((.*)\);$)m',$productList,$matches);
  12. list(,$value,$desc) = $matches;
  13.  
  14. var_dump($value,$desc);
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
array(5) {
  [0]=>
  string(20) "Saluran Dua(Bothway)"
  [1]=>
  string(15) "Speedy Password"
  [2]=>
  string(4) "Memo"
  [3]=>
  string(13) "7-pib r-10/10"
  [4]=>
  string(11) "FBI (R/N/M)"
}
array(5) {
  [0]=>
  string(6) "TAN007"
  [1]=>
  string(9) "INET PASS"
  [2]=>
  string(6) "T-Memo"
  [3]=>
  string(2) "AM"
  [4]=>
  string(2) "Rr"
}