ローテーターのコーディング方法は知っていますが、空の $stuff_link 変数をスキップするものを作成するにはどうすればよいですか?
以下に示すように、4 つのリンク変数がありますが、空白になることがあります。だから私がする必要があるのは、ローテーターを使用して 4 つの変数間を回転させることですが、たとえば $stuff_link が空白の場合はスキップして渡します。
$stuff_link
$stuff_link2
$stuff_link3
$stuff_link4
以下のコードは、内部に配置する場所です。
if(percentChance(35) && $stuff_status == 1)
{
rotator goes here
}
以下は、percentChance の関数です。
function percentChance($chance){
// Notice we go from 0-99 - therefore a 100% $chance is always larger
$randPercent = mt_rand(0,99);
return $chance > $randPercent;
}