直接对数组进行修改就好了
$arr=Array(3=>"ab",1=>"abc");
print_r($arr);
$arr[3]=md5($arr[3]);
$arr[1]=md5($arr[1]);
echo "
";
print_r($arr);
?>
$arr = array ( '3' => 'ab', '1' => 'abc' );
$newarr = array();
foreach($arr as $key=>$val){
$newarr[$key] = md5($val);
}
print_r($newarr);
array[a] = 100; //create a new element
unset(array[0]); //remove the old one
这问题什么意思啊,遍历就是啊