Is there any way to create a loop of variables inside list()
I've tried this code but it doesn't work.
$long_string = "one , two , three , four";
$list = explode(" , ",$long_string);
$count_list = count($list);
list(for($i = 0; $i <= $count_list; $i++){ return ${"list$i"}; }) = explode(" , ",$long_string);
Update : Got the solution, thanks
$list[0],$list[1]etc already has what you need.list()it must belist($variable1, $variable2, $variable3, $variable4) = explode(" , ",$long_string);right? but in this case I trying to create a loop for the variable instead