duannue2455 2016-04-25 11:53
浏览 29
已采纳

preg_match长度宽度高度

I open a csv-file in php and I do have columns with multiple rows that looks like this:

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

How do I get with preg_match the length, height, width in the string and even the unit cm, mm.

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

Thanks for help!

  • 写回答

1条回答 默认 最新

  • dongque8332 2016-04-25 11:59
    关注

    Have You Try This?

    (\d+)x(\d+)x(\d+)(\w+)
    

    please let me know if it doesn't work..

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程