Forum Discussion
Kai_Wilke
Dec 17, 2015MVP
Hi Piotr,
arrays can be very much handled like classic variables. The differences are not that much, but they the will also add certain functionality that you should remind when writing more or less complex code.
- $array($var_name), $array($var_name1$var_name2(key1)) or $array([command]) will work without using [eval].
- $array(quick brown fox) will work without tranforming the spaces.
- [unset array] will unset every contained entry in one step.
Because of the [unset] feature I tend to organise my code using $reqest(var_names), $temp(var_names) and $connection(var_names), where...
- the $temp(keys) MAY be flushed after each request to free memory.
- the $reqest(keys) MUST be flushed at the beginning of each request.
- the $connection(keys) MUST persist for the entire connection. But a single key MAY be erased as needed.
Using this scheme makes variable handling very comfortable and much more effective compared to regular variables^^
Cheers, Kai