$case_cost = 39; $list_skins = [ $skin_1 = ['GLOVES/Champion.webp', 'GLOVES', 'Champion', 'gradient_gold', 1899], $skin_2 = ['GLOVES/Burning_Fists.webp', 'GLOVES', 'Burning Fists', 'gradient_gold', 2100], $skin_3 = ['GLOVES/Steam_Rider.webp', 'GLOVES', 'Steam Rider', 'gradient_gold', 1400], $skin_4 = ['GLOVES/Punk.webp', 'GLOVES', 'Punk', 'gradient_gold', 2887], $skin_5 = ['AWM/BOOM.webp', 'AWM', 'BOOM', 'gradient_arcane', 200], $skin_6 = ['M4A1/Bubblegum.webp', 'M4A1', 'Bubblegum', 'gradient_arcane', 249], $skin_7 = ['USP/Chameleon.webp', 'USP', 'Chameleon', 'gradient_legendary', 23], $skin_8 = ['Desert_Eagle/Orochi.webp', 'Desert Eagle', 'Orochi', 'gradient_legendary', 21], $skin_9 = ['M60/Grunge.webp', 'M60', 'Grunge', 'gradient_legendary', 20], $skin_10 = ['Famas/Anger.webp', 'Famas', 'Anger', 'gradient_epic', 3], $skin_11 = ['M60/Steam_Beast.webp', 'M60', 'Steam Beast', 'gradient_epic', 2.90], $skin_12 = ['MP7/Palace.webp', 'MP7', 'Palace', 'gradient_epic', 2.70], $skin_13 = ['P350/Oni.webp', 'P350', 'Oni', 'gradient_rare', 0.56], $skin_14 = ['M4/Demon.webp', 'M4', 'Demon', 'gradient_rare', 0.55], $skin_15 = ['M4A1/Kitsune.webp', 'M4A1', 'Kitsune', 'gradient_rare', 0.65], $skin_16 = ['TEC9/Tropic.webp', 'TEC9', 'Tropic', 'gradient_rare', 0.52], $skin_17 = ['AKR/Scale.webp', 'AKR', 'Scale', 'gradient_uncommon', 0.17], $skin_18 = ['AWM/Elevation.webp', 'AWM', 'Elevation', 'gradient_uncommon', 0.24], $skin_19 = ['SM1014/Tropic.webp', 'SM1014', 'Tropic', 'gradient_uncommon', 0.10], $skin_20 = ['UMP45/Peaceful.webp', 'UMP45', 'Peaceful', 'gradient_uncommon', 0.11], $skin_21 = ['AKR12/Roar.webp', 'AKR12', 'Roar', 'gradient_common', 0.05], $skin_22 = ['G22/Scale.webp', 'G22', 'Scale', 'gradient_common', 0.07], ]; $num_items = count($list_skins); foreach ($list_skins as &$value) { print_r(($case_cost / $num_items) * (1 / end($value))); unset($value); print ''; }