- ThinkPHP3.2在import需要以点分隔路径,且文件路径名必须大小写一致,如 :
import('Org.Util.Image');
- ThinkPHP3.2在new对象时,需要先import,再在new时指明路径,创建对象后再调用方法,如:
$Image = new \Image();
$Image->buildImageVerify(4,2,'png',60,30);
$this->city_id = I('get.city_id');
import('Org.Net.IpLocation');
$IpLocation = new \IpLocation('UTFWry.dat');
$result = $IpLocation->getlocation($_SERVER['REMOTE_ADDR']);
foreach ($this->citys as $val)
{
if (strstr($result['country'], $val['name']))
{
$city = $val;
$this->city_id = $val['city_id'];
break;
}
}