Can I use simultaneously all the array indexes in PHP by IF?

To work with the Back-End part of the website you want to check whether the entered data in the database. Valid options are listed in the data array. PL - PHP.

I tried to import the loop for, but my knowledge is not enough.
The list of valid options data:
$trueVals = [
 'survPro' => "surv_pro",
 'survPremium' => "surv_premium",
 'survFly' => "surv_fly",
 'survGod' => "surv_god",
 'survCreative' => "surv_creative",
 'survAntigriefer' => "surv_antigriefer",
 'survSponsor' => "surv_sponsor",
 'survLuxe' => "surv_luxe",
 'anPro' => "anarchy_pro",
 'anPremium' => "anarchy_premium",
 'anLegend' => "anarchy_legend",
 'anSponsor' => "anarchy_sponsor",
 'sbVip' => "skyblock_vip",
 'sbFly' => "skyblock_fly",
 'sbSponsor' => "skyblock_sponsor",
 'sbMaster' => "skyblock_master",
 'sbLegend' => "skyblock_legend",
 'gtaMafia' => "gta_mafia",
 'gtaEngineer' => "gta_engineer",
 'gtaBusiness' => "gta_business",
 'gtaRich' => "gta_rich",
 'gtaMar' => "gta_mar",
 'gtaGubernator' => "gta_gubernator",
 'gtaDeputate' => "gta_deputate",
 'gtaMinistr' => "gta_ministr",
 'gtaPresident' => "gta_president",
 'hPro' => "hardcore_pro",
 'hPremium' => "hardcore_premium",
 'hGriefer' => "hardcore_griefer",
 'hLuxe' => "hardcore_luxe",
 'hFly' => "hardcore_fly",
 'hCreative' => "hardcore_creative"
 ];
April 3rd 20 at 17:22
2 answers
April 3rd 20 at 17:24
Solution
foreach($trueVals as $key => $value) {

}
it can not be - Clifford_Wintheiser commented on April 3rd 20 at 17:27
@Clifford_Wintheiser, I don't know why I'm so smart - Telly.Moscis commented on April 3rd 20 at 17:30
@Telly.Moscis, you can at least near you to stand up? - Clifford_Wintheiser commented on April 3rd 20 at 17:33
@Telly.Moscis,
I don't know why I'm so smart
it is an illusion. - shanny.Corw commented on April 3rd 20 at 17:36
@Clifford_Wintheiser, with us, with me no - Telly.Moscis commented on April 3rd 20 at 17:39
April 3rd 20 at 17:26
Solution

Find more questions by tags PHP