<?php
array('code' => '001', 'name' => 'Banco do Brasil'), array('code' => '003', 'name' => 'Banco da AmazĂ´nia'), array('code' => '004', 'name' => 'Banco do Nordeste'), array('code' => '021', 'name' => 'Banestes'), array('code' => '025', 'name' => 'Banco Alfa'), array('code' => '027', 'name' => 'Besc'), array('code' => '029', 'name' => 'Banerj'), array('code' => '031', 'name' => 'Banco Beg'), array('code' => '033', 'name' => 'Banco Santander Banespa') );
echo BancoPorID( '001' ) . PHP_EOL;
echo BancoPorID( '033' ) . PHP_EOL;
echo BancoPorID( '027' ) . PHP_EOL;
function BancoPorID($id) {
global $bancos;
return $key !== false ? $bancos[$key]['name'] : 'Banco desconhecido';
}
PD9waHAKCgkkYmFuY29zID0gYXJyYXkoCgkgICAgYXJyYXkoJ2NvZGUnID0+ICcwMDEnLCAnbmFtZScgPT4gJ0JhbmNvIGRvIEJyYXNpbCcpLAoJICAgIGFycmF5KCdjb2RlJyA9PiAnMDAzJywgJ25hbWUnID0+ICdCYW5jbyBkYSBBbWF6w7RuaWEnKSwKCSAgICBhcnJheSgnY29kZScgPT4gJzAwNCcsICduYW1lJyA9PiAnQmFuY28gZG8gTm9yZGVzdGUnKSwKCSAgICBhcnJheSgnY29kZScgPT4gJzAyMScsICduYW1lJyA9PiAnQmFuZXN0ZXMnKSwKCSAgICBhcnJheSgnY29kZScgPT4gJzAyNScsICduYW1lJyA9PiAnQmFuY28gQWxmYScpLAoJICAgIGFycmF5KCdjb2RlJyA9PiAnMDI3JywgJ25hbWUnID0+ICdCZXNjJyksCgkgICAgYXJyYXkoJ2NvZGUnID0+ICcwMjknLCAnbmFtZScgPT4gJ0JhbmVyaicpLAoJICAgIGFycmF5KCdjb2RlJyA9PiAnMDMxJywgJ25hbWUnID0+ICdCYW5jbyBCZWcnKSwKCSAgICBhcnJheSgnY29kZScgPT4gJzAzMycsICduYW1lJyA9PiAnQmFuY28gU2FudGFuZGVyIEJhbmVzcGEnKQoJKTsKCQogICAgZWNobyBCYW5jb1BvcklEKCA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