How to split a string by multiple delimiters in PHP?

前端 未结 4 1231
温柔的废话
温柔的废话 2020-11-28 13:16

\"something here ; and there, oh,that\'s all!\"

I want to split it by ; and ,

so after processing should get:

4条回答
  •  盖世英雄少女心
    2020-11-28 13:55

    ', print_r( preg_split( $pattern, $string ), 1 ), '
    ';

    Updated answer to an updated question:

    ', print_r( preg_split( $pattern, $string ), 1 ), '
    ';

提交回复
热议问题