fork(1) download
  1. <?php
  2.  
  3. $str = "country:00/00/1000->link:00/00/2000->link2
  4. country2:00/00/1000->link3:00/00/2000->link4";
  5.  
  6. $arr = split("\n", $str);
  7. print_r($arr);
  8. for ($i = 0; $i < count($arr); $i++) {
  9. preg_match("/^(\w+)\:(\d\d\/\d\d\/\d\d\d\d)->(\w+)\:(\d\d\/\d\d\/\d\d\d\d)->(\w+)/", $arr[$i], $matches);
  10.  
  11. print_r($matches);
  12. }
  13.  
  14. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => country:00/00/1000->link:00/00/2000->link2
    [1] => country2:00/00/1000->link3:00/00/2000->link4
)
Array
(
    [0] => country:00/00/1000->link:00/00/2000->link2
    [1] => country
    [2] => 00/00/1000
    [3] => link
    [4] => 00/00/2000
    [5] => link2
)
Array
(
    [0] => country2:00/00/1000->link3:00/00/2000->link4
    [1] => country2
    [2] => 00/00/1000
    [3] => link3
    [4] => 00/00/2000
    [5] => link4
)