php實現城市切換

來源:互聯網
上載者:User
4) return 0;    foreach($ip as $ip_addr) {        if ( !is_numeric($ip_addr) ) return 0;        if ( $ip_addr<0 || $ip_addr>255 ) return 0;    }    return 1;}$ip=$_SERVER['REMOTE_ADDR']; $ifErr=$QQWry->QQWry($ip); $city = $QQWry->Country.$QQWry->Local;//echo $city;*/if (strpos($city,'玄武區')!==false){    $city = "玄武區";}else if(strpos($city,'仙林')!==false){    $city = "仙林";}else if(strpos($city,'秦淮區')!==false){    $city = "秦淮區";}else if(strpos($city,'江寧')!==false){    $city = "江寧";}else if(strpos($city,'鼓樓')!==false){    $city = "鼓樓";}else{    $city = "棲霞";}if (isset($_GET['chengshi'])) { //Ê×Ïȼì²âÊÇ·ñ»ñµÃÁË GET ´«µÝµÄÊý¾Ý    setcookie("cookie_city",$_GET['chengshi'],time()+3600*24);$city = $_GET['chengshi']; } else if (isset($_COOKIE["cookie_city"])) { //¼ì²âÊÇ·ñ´æÔÚêdzÆCookie   $city = $_COOKIE["cookie_city"]; //ÏÔʾCookie±£´æµÄÊý¾Ý } else {   setcookie("cookie_city",$city,time()+3600*24); //´¿³õʼ»¯´Ë±äÁ¿ $_COOKIE["cookie_city"] = $city;} ?>城市切換
玄武區 仙林 秦淮區 鼓樓 江寧 棲霞區
全部
  • 全部小區
  • 切換城市

鐘志遠 江蘇南京 904727147

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.