fork download
  1. <?php
  2.  
  3. $results = array(
  4. 'custom_params' => 'custom_limit="0"|input_label="{\"label_values\":[\"\u9650\u5916\u5e36\",\"\u9650\u5167\u7528\",\"\u9650\u6642\u5546\u54c1\",\"\u514d\u9810\u7d04\",\"\u5373\u8cb7\u5373\u7528\",\"\u672c\u9031\u5f37\u6a94\",\"\u611b\u5fc3\u516c\u76ca\"]}"|repeat_label=""|'
  5. );
  6. $custom_params = explode('|', $results['custom_params']);
  7. foreach ($custom_params as $param) {
  8. if (preg_match('/^input_label="(.*)"$/', $param, $match)) {
  9. $input_label = json_decode(str_replace('\"', '"', $match[1]), true);
  10. $label_values = $input_label['label_values'];
  11. break;
  12. }
  13. }
  14. var_dump($label_values);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
array(7) {
  [0]=>
  string(9) "限外帶"
  [1]=>
  string(9) "限內用"
  [2]=>
  string(12) "限時商品"
  [3]=>
  string(9) "免預約"
  [4]=>
  string(12) "即買即用"
  [5]=>
  string(12) "本週強檔"
  [6]=>
  string(12) "愛心公益"
}