lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


[...]
> 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