<?php // 請填入本平台提供的 txid 值並填入在單引號內 $txid = 'c19db6709526fe662bf574f886ca22b3a1d44d8a1001ea815c5aceae48e013ff'; // 總共幾個大賞 $prize_count = 20; // 總共幾個籤數 $tag_count = 250; $dec = gmp_init($txid, 16); $prize_tmp = []; $prize_tmp_count = 0; $step_tmp = 100; $step = 1; $max_count = 100; try { while ($step <= $max_count) { $powResult = gmp_pow($step_tmp, $step); $div = gmp_div_q($dec, $powResult); $mod = gmp_mod($div, $tag_count); $prize_number = (int)gmp_strval($mod) + 1; if (!in_array($prize_number, $prize_tmp)) { $prize_tmp[] = $prize_number; $prize_tmp_count++; } if ($prize_tmp_count >= $prize_count) { break; } $step++; } echo implode(', ', $prize_tmp); } catch (\Exception $e) { echo $e->getMessage(); }
You have javascript disabled. You will not be able to edit any code.