Hi, I'm having trouble using the split function.
The string holds multiple variables in commas (ie. "var1,var2,var3,var4"). The number of variables in the string changes unpredictably (so I never know how many variables a string holds). I need to be able to count the string, and split it's variables into arrays. I'm having trouble doing that. Here's how far i've gotten :
<?php
$string="Hello, how, are, you, doing, today"; //the length of this string will dynamically change
$ccount=substr_count($string,",");
$numsus=$ccount++;
$array[$numsus] = split(',',$string); //this is the part I don't know how to do
?>
I've figured out how to count the amount of variables in the string, but I can't figure out how to split it into arrays. Any help will be deeply appreciated!
Thanks.