Home > Backend Development > PHP Tutorial > 满100减50 如何把100和50抽出来呢~ 满的数字和减的数字不一样

满100减50 如何把100和50抽出来呢~ 满的数字和减的数字不一样

WBOY
Release: 2016-06-13 12:59:37
Original
1036 people have browsed it

满100减50 怎么把100和50抽出来呢~~ 满的数字和减的数字不一样
满100减50  怎么把100和50抽出来呢~~ 


满的数字和减的数字不一样哦~~~求一个通用例子
------解决方案--------------------

$s = '满100减50';<br />
<br />
preg_match_all('/(\D+)(\d+)/', $s, $r);<br />
$t = array_combine($r[1], $r[2]);<br />
<br />
print_r($t);
Copy after login
Array
(
    [满] => 100
    [减] => 50
)

带上文字,便于识别

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template