fork(1) download
  1. <?php
  2.  
  3. $re = '/(\w+)\s*=\s*([^;]*)/';
  4. $str = 'FIRM_ID = MC0356400000; TAG = EQTV; CURR_CODE = SUR; CLIENT_CODE = FR334; LIMIT_KIND = 1; OPEN_BALANCE = 4822.84; OPEN_LIMIT = 0.00; LEVERAGE = 0;';
  5. preg_match_all($re, $str, $matches);
  6. print_r(array_combine($matches[1],$matches[2]));
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [FIRM_ID] => MC0356400000
    [TAG] => EQTV
    [CURR_CODE] => SUR
    [CLIENT_CODE] => FR334
    [LIMIT_KIND] => 1
    [OPEN_BALANCE] => 4822.84
    [OPEN_LIMIT] => 0.00
    [LEVERAGE] => 0
)