HTML form's array not returned as array?

Neah, my mistake! :]

[s]I just want to confirm, if I made some bug or did discover some strange feature of how PHP processes HTML forms?

I’m using a large form that contains n number of checkboxes. I gather them into array (one model attribute).

Since CFormModel, which gathers all attributes into array, in result checkboxes must be kept in two dimensional array.


$checkBoxName = 'RejestracjaForm[examinations][]';

Everything worked fine until I was testing form with checking at least two checkboxes (or none at all). But when I selected only one and echoed $model->examinations I’ve got:


$model->examinations = "90"

Can it be possible, that returns a string instead of array with just one element in such situation?

This seems to be very strange, if true. For what reason such conversion would be made? But I double checked my code, that I don’t modify $model->examinations, then var_dump’ed it as good as var_dump(is_array($model->examinations)). And it seems that yes, $model->examinations is a string in this situation, because first var_dump returned string(2) and second - FALSE ($model->examinations is not an array). [/s]