Submitted by abitowhit on Sun, 08/22/2021 - 18:39
PHP Splitting string into an array
I found it interesting that there was not a simple split in php, it is something I use continuously.
Turns out it is not split but actually str_getcsv
Usage:
$dat="string1,string2,string3";
$spl = str_getcsv($dat,",");
echo $spl[0];
echo $spl[1];
echo $spl[2];