根据域名调用城市信息[全国二级域名]
本文章为你做一个页面,根据用户输入的域名调用不同城市的信息
function getServerName()
{
$ServerName = strtolower($_SERVER['SERVER_NAME']?$_SERVER['SERVER_NAME']:$_SERVER['HTTP_HOST']);
if( strpos($ServerName,'http://') )
{
return str_replace('http://','',$ServerName);
}
return $ServerName;
}
/*
@取得城市编号
#$sn string
#return int;
*/
function getDomainCity( $sn )
{
if( empty( $sn ) )
{
return 0;
}
else
{
$Db = new Db();
$sql = "Select id,domain from cityid where domain='$sn' limit 1";
$query = $Db->query( $sql );
if( $Db->row )
{
$rs = $Db->fetch( $query);
return $rs[0];
}
else
{
return 0;
}
}
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools
