fork(1) download
  1. <?php
  2. $a="name3:::::value3;;;;;name4:::::value4;;;;;name5:::::value5";
  3. preg_match_all('/(?<=^|;;;;;).+?(?=:::::)/',$a,$keys);
  4. preg_match_all('/(?<=:::::).+?(?=$|;;;;;)/',$a,$values);
  5. $all=array_combine($keys[0],$values[0]);
  6. print_r($all);
  7.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [name3] => value3
    [name4] => value4
    [name5] => value5
)