I used the JSON to create an array multidimensional. Now my problem is how to make groups of checkboxes (into tables or in anything to make possible separating them, by horizontal bars for example).
This is a example of the lines of the file:
{"id": "v0", "namegroup": "Table rules create OR insert", "rule": "All classes give origin to a table.", "value": 0}
And this is how i create the array:
[php]
$file = fopen(“rules.txt”, “r”) or exit(“Unable to open file!”);
$arrayRules = array();
$i = 0;
while(!feof($file))
{
$line = fgets($file);
$content = json_decode(utf8_encode($line), true);
$arrayRules[$i][‘id’] = $content[“id”];
$arrayRules[$i][0] = utf8_decode($content[“rule”]);
$arrayRules[$i][‘namegroup’] = $content[“namegroup”];
$arrayRules[$i][1] = $content[“value”];
$i = $i + 1;
}
fclose($file);
[/php]
And this is how i output the checkboxes:
[php]
echo “<input name=“regra[]” value=”" . $arrayRules[$i][“id”] . “” type=“checkbox” /> " . $arrayRules[$i][0] . "
" ;
[/php]
Remember that the user can edit the name of the group and all the other points. As you can notice, my problem is not how to echo checkbox, but how will be the mechanism with the propose of creating and organize the checkboxes by groups.
Hope you guys understood it, to help me,
Thanks all, Michael