@minots: simplify what you are doing:
<?php
function sqlite_escape_array( &$arr ) {
$invalid = array( 'argv', 'argc' );
foreach ( $arr as $key => $val )
if ( ( strtoupper( $key ) != $key ) && !is_numeric( $key ) && !in_array( $key, $invalid ) ) {
if ( is_string( $val ) )
$arr[$key] = sqlite_escape_string( $val );
else if ( is_array( $val ) )
sqlite_escape_array( $arr[$key] );
}
return $arr;
}
?>
I'm not sure if the condition is equivalent to yours, but this excludes any numeric key, any completely uppercase'd keys and some selected (argc and argv) special keys. In case of never passing $GLOBALS or $_SERVER as argument one might shorten everything to this as a "pipelined" version:
<?php
function sqlite_escape_array( $arr ) {
foreach ( $arr as $key => $val )
if ( is_string( $val ) )
$arr[$key] = sqlite_escape_string( $val );
else if ( is_array( $val ) )
$arr[$key] = sqlite_escape_array( $val );
return $arr;
}
?>
PHP's syntax is more powerful than those of many other languages, even when it's supporting their one's as well.