fork(1) download
  1. <?php
  2.  
  3. $models = array(
  4. "name" => "Samsung GT-N7100 Galaxy Note II 16GB",
  5. "name" => "Samsung GT-P5110 Galaxy S 4 10.1 16GB"
  6. );
  7.  
  8. foreach($models as $key => $model) {
  9. if (preg_match('/Samsung(?=.*?Galaxy S)/i', $model)) {
  10. echo $model;
  11. }
  12. }
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Samsung GT-P5110 Galaxy S 4 10.1 16GB