第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

使用 PHP 隨機(jī)重定向

使用 PHP 隨機(jī)重定向

PHP
尚方寶劍之說 2022-09-24 17:19:13
我試圖隨機(jī)重定向2 URL,但它不起作用。我的代碼<?php$urls=readStack();if(empty($urls)) {    $urls = shuffle(array('https://domain1.com', 'https://domain2.com'));     $url=array_pop($urls);    storeStack($urls);    header('Location:' .$url); ?>幫助如何解決這個(gè)問題?
查看完整描述

1 回答

?
慕婉清6462132

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超2個(gè)贊

我不知道是什么,但你可能想要這樣的東西readStack()storeStack()


$arr = array('https://domain1.com', 'https://domain2.com');

shuffle($arr); // This returns a boolean and the array is modified inside the function so just pass in the array

$url=array_pop($arr); // Pop the top most element from the array and store into $url

header("Location: $url");

僅該代碼就為您提供了來自這兩個(gè)的隨機(jī)URL


查看完整回答
反對 回復(fù) 2022-09-24
  • 1 回答
  • 0 關(guān)注
  • 78 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號