preg_match长度宽度高度


preg_match length width height

我在 php 中打开一个 csv 文件,我确实有多行的列,如下所示:

1 | Some word 18x140x2000mm another word
2 | 20x150x300cm couple other words
3 | new words 30x140x2100mm

我如何获得preg_match字符串中的长度、高度、宽度,甚至单位厘米、毫米。

1 | $attributes = array(18, 140, 2000, mm);
2 | ...

感谢您的帮助!

你试过这个吗?

('d+)x('d+)x('d+)('w+)

如果它不起作用,请告诉我..