Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jsanwo64's avatar
Level 11

Get bank from array where similar

i have a function that gets list of banks from Flutterwave. now what i get from Flutterwave api is bank name bank code and bank id.

i have an array of banks and code now i want to check if the banks fetched from Flutterwave are similar to the banks on the array if there are any that are similar let's say Zenith Bank and Zenith Bank plc, fetch the code in the array and save together with bank_id, bank_name, and bank_code and code to the Db but if the bank is not on the array list save the code of that bank to db as null the array is

      // Predefined bank codes and names
      protected $predefinedBanks = [
        'Sterling Bank' => '000001',
        'Keystone Bank' => '000002',
        'FCMB' => '000003',
        'United Bank for Africa' => '000004',
        'Diamond Bank' => '000005',
        'JAIZ Bank' => '000006',
      
    ];
0 likes
1 reply

Please or to participate in this conversation.