I am trying to generate an associate array with random values. For example, if I give you this string:
something, anotherThing, foo, bar, baz
(the length of the string is dynamic - so there could be 10 items, or 15);
I would like to create an array based on those values:
$random = rand();
array("something"=>$random, "anotherThing"=>$random, "foo"=>$random, "bar"=>$random, "baz"=>$random);
And it builds the array based on how many values it's given.
I know how to order them into an array like so:
explode(", ", $valueString);
But how can I assign the values to make it an associative array?
Thanks.