[TYPO3-dev] TCA in loop doesn't work
Bernhard Kraft
kraftb at kraftb.at
Mon Jan 2 23:33:17 CET 2006
Christoph wrote:
> Instead of explode, I now use t3lib_div :: trimExplode and it works nicely.
PS:Add "true" as third parameter of t3lib_div::trimExplode(,, true);
so ",," will result in an empty array and not 3 elements with a value of "" (nothing).
foreach ($array as $key => $value) {
(if you require to know the keys and values of each associated pair)
other possible constructs are:
---------
reset($array)
while ($item = each($array)) {
...
}
-----------
or:
-----------
reset($array);
while (list($key, $value) = each($array)) {
...
}
-----------
JFYI
Bernhard
More information about the TYPO3-dev
mailing list