php - Array push to multi dimentional array -
i'm new php , arrays. have array named $get contains:
array (size=5) 0 => array (size =3) 'name' => string '6jj3shdg2dciq92p0felyw==' (length =24) 'email' => string 'uyyyxvif7yoso+nxlxrokxj8oulfop9eondvmxc+ze8=' (length=44) 'password'=> string 'umxcws0oxgtomcdwkhzuca==' (length =24) 1 => array (size =3) 'name' => string 'gjtduw6nwmjquog/lwwycg==' (length =24) 'email' => string 'ghi5v7tzyabdlb1icr8tuw==' (length =24) 'password'=> string 'umxcws0oxgtomcdwkhzuca==' (length =24) 2 => array (size =3) 'name' => string 'pb/6qlhq/xe8irmjwglb8g==' (length =24) 'email' => string 'zvtxuau05ubgzoen/cy0xq==' (length =24) 'password'=> string 'umxcws0oxgtomcdwkhzuca==' (length =24) 3 => array (size =3) 'name' => string 'nyfzzmazxz7f5zv9je7x5a==' (length =24) 'email' => string '0oyjhud9u5phlku+wv9xhq==' (length =24) 'password'=> string 'umxcws0oxgtomcdwkhzuca==' (length =24) 4 => array (size =3) 'name' => string 'xejyjrwo0jkt4xjsrct6/a==' (length =24) 'email' => string 'jqyw/v9ratijs8m9qwprwa==' (length =24) 'password'=> string 'umxcws0oxgtomcdwkhzuca==' (length =24)
i looping each 1 of them decrypt it. how can save array or overwrite array decrypted one? here's how decrypt , loop it.
$get = users::getall(); $decr= new cipher("somekey"); foreach( $get $result ) { //decryption $new_decrypted_name = $decr->decrypt($result['name']); $new_decrypted_email = $decr->decrypt($result['email']); $new_decrypted_password= $decr->decrypt($result['password']); }
i've searched seems have different implementation. thanks!
you can this:
$get = users::getall(); $decr = new cipher("somekey"); foreach( $get $key => $result ) { $get[$key]['name'] = $decr->decrypt($result['name']); $get[$key]['email'] = $decr->decrypt($result['email']); $get[$key]['password'] = $decr->decrypt($result['password']); }
php arrays loops multidimensional-array
No comments:
Post a Comment