[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Shorthand for appending to a table (was Re: 5.2 feature list?)
- From: "Kucera, Rich" <Kucerar@...>
- Date: Tue, 12 Sep 2006 10:58:07 -0400
[...]
> The same thing in PHP actually starts to reveal some meaning, do some
> work:
>
> function convertToDisplayValues( $recordForView ) {
> foreach ( $recordForView as $fieldName => $fieldVal ) {
> if ( $fieldVal == "on" ) {
> $recordForView[$fieldName] = "*** ADD ***";
> }
> ...
Eh, array_walk. "create_function" looks kind of clunky, needs to be
sugar...
array_walk( $recordForView,
create_function('&$item1,$key,$prefix',
'$item1=($item1 == "on")?$prefix:""'),
'*** ADD ***');
-R