时间:2021-07-01 10:21:17 帮助过:29人阅读
问题没说清楚
$s = "server_model=ProLiant DL360 G5;; server_cpu_model=Intel(R) Xeon(R) CPU E5405 @ 2.00GHz;; cpu=21mhz;1;3;5;8";preg_match_all('/\s*(\S.+)(?:;;|$)/U', $s, $m);print_r($m[1]);
Array( [0] => server_model=ProLiant DL360 G5 [1] => server_cpu_model=Intel(R) Xeon(R) CPU E5405 @ 2.00GHz [2] => cpu=21mhz;1;3;5;8)
感谢回复,已经很接近了,但我加了2个数据测试,发现了点小问题,烦请帮忙。谢谢!
server_model=ProLiant DL360 G5;; server_cpu_model=Intel(R) Xeon(R) CPU E5405 @ 2.00GHz;; swap=3989MB;0;0;0;3999 memory=158MB;;;;1869