psAryUpdate() Updates an array from another array
Description:
Good for updateing an existing array from $_GET array
Usage:
$aryOrig = psAryUpdate($aryDst,$arySrc,$flg=false);
$flg - strict - if you want to update known keys true: will only update a key in $aryDst if exists false: all keys are coppied from src to dst
Example:
$aryOrig = psAryUpdate($aryOrig,$_GET);
Code:
function psAryUpdate($aryDst, $arySrc, $flg = false) { foreach ($arySrc as $key=>$val) { if ($flg == false) { $aryDst[$key] = $val; } else { if ( array_key_exists($key,$aryDst) == true ) { $aryDst[$key] = $val; } } } return $aryDst; }
Changlelog:
|
|