PHP - 允许字符串编号和几个符号

时间:2015-08-31 06:48:46

标签: php mysql csv

如何允许preg_replace字符串,数字和几个符号?

preg_replace("/[^0-9]/","",$data[0]); //only works fine for numbers

列值为:

Technische achtergrond,0,1
Maritieme bediende,1,1
Transport rijbewijs C en CE,0,4
Commercieel bediende,1,5
Heftruck/Reachtruck(technisch operator),0,5
Boukhouding/Financieel,1,3

1 个答案:

答案 0 :(得分:1)

preg_replace("#[^0-9a-z\(\),/\-\.'\" ]#i", "", $data[0]);