Add some code optimization

Added some code optimization to general function: !empty instead of sizeof $array > 0, precount variable outside for loops and  foreach($aHash as $key => $val);  instead of while(list($key,$val) = each($aHash));
Revert for loop precount as it executeed only one time.

Revert attributes loop precount as it is executed only one time.
revert microoptimization

Revert for loop precount as it is executed only one time
Merge pull request #8 from acidvertigo/patch-7

Add some code optimization