You can use the explode function to turn the initial value into an array:
$bin="1,2,3,4,5,6,ABC,AAA,77,00,11,AS,Code";
$array_of_values = explode(',' $bin);
That will give you a numerically indexed array, which looks like this:
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => ABC
[7] => AAA
[8] => 77
[9] => 00
[10] => 11
[11] => AS
[12] => Code
)
You can just use that and access individual values by their index:
echo $array_of_values[0]; // 1
See more about arrays: http://php.net/manual/en/language.types.array.php
From there, if you want to set the values into variables, you can use this loop, which uses "variable variables":
$bin= "1,2,3,4,5,6,ABC,AAA,77,00,11,AS,Code";
$array_of_values = explode(',', $bin);
$vn = 'NN';
foreach ($array_of_values as $k=>$v) {
${$vn.$k} = $v;
}
echo 'NN1:'.$NN1; // NN1:2
echo 'NN2:'.$NN2; // NN2:3
echo 'NN2:'.$NN3; // NN3:4
Try it: http://codepad.org/Ee8F9F18
Documentation
$NNxx? What if there are more than 100 variables...$NNxxx?