Splitting by a semicolon not surrounded by quote signs

后端 未结 3 2037
感情败类
感情败类 2021-01-23 11:07

Well, hello community. I\'m workin\' on a CSV decoder in PHP (yeah, I know there\'s already one, but as a challenge for me, since I\'m learning it in my free time). Now the prob

3条回答
  •  感动是毒
    2021-01-23 11:51

    You can use this function str_getcsv in this you can specify a custom delimiter(;) as well.

    Try this code snippet

    Output:

    Array
    (
        [0] => 0;0
        [1] => 1
        [2] => 2
        [3] => 3
        [4] => 4
    )
    

提交回复
热议问题