regex preg_match for digit in middle for a string

前端 未结 3 617
走了就别回头了
走了就别回头了 2021-01-29 07:29
ddw_0_op1
ddw_1_op1
ddw_2_op1
ddw_3_op1
ddw_4_op1

in these strings of array how i can extract or preg_match only the number in middle that increase . t

3条回答
  •  长发绾君心
    2021-01-29 07:41

    I would break the string on underscore:

    $parts = explode('_', $string);
    $middle = $parts[1];
    

提交回复
热议问题