PHP explode and assign it to a multi-dimensional array

前端 未结 6 1895
天命终不由人
天命终不由人 2021-01-19 17:11

i want to explode a string two time and make a multi-dimensional array.

$data = \"i love funny movies \\n i love stackoverflow dot com \\n i like rock song\"         


        
6条回答
  •  一整个雨季
    2021-01-19 17:45

    Try

    $data = "i love funny movies \n i love stackoverflow dot com \n i like rock song";
    $data = explode("\n", $data);
    for($i=0;$i

    demo here

提交回复
热议问题