fork download
  1. <?php
  2.  
  3. $var_name = 'FIRM_ID';
  4. $re = '/' . $var_name . '\s*=\s*\K[^;]*/';
  5. $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;';
  6. preg_match($re, $str, $m);
  7. print_r($m);
  8. echo "\n" . $m[0];
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => MC0356400000
)

MC0356400000