摘要:
今天写了一个解析国家行政区域的类,但是看到别人的代码,自己觉得的特别好,评论也很好,但是我看了半天没有看懂,现在写出来分析下,先贴上代码我把分析放到注释中去 1 <?php 2 3 // config 4 $host = ''; 5 $dbname = ''; 6 $charset = ''; 7 $username = ''; 8 $password = ''; 9 10 set_time_limit(0);11 12 $dsn = "mysql:host={$host};dbname={$dbn 阅读全文
posted @ 2013-01-17 17:59
linksgo2011
阅读(291)
评论(0)
推荐(0)
摘要:
1 <?php 2 /* 3 * 解析国家行政区域的类,s使用方法为使用文件地址实例化然后调用getResult()方法即可,获取数组形式的数据 4 */ 5 class AnalyRegion { 6 7 public $file; 8 public $results = array(); 9 10 private $handle;11 12 public function __construct($file){13 $this->file = $file;14 ... 阅读全文
posted @ 2013-01-17 17:41
linksgo2011
阅读(187)
评论(0)
推荐(0)
摘要:
1、Yii文件上传 表单的规范 <form enctype="multipart/form-data" action="<?php echo $this->createUrl('importRegion') ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> 选择文件: <input name="us 阅读全文
posted @ 2013-01-17 17:35
linksgo2011
阅读(255)
评论(0)
推荐(0)
摘要:
1、下载Yii并解压 地址:http://www.yiiframework.com/download/2、拿出framework文件夹,放在服务器的webroot目录下,打开命令行,导航到webroot执行一下命令创建一个应用 1 % YiiRoot/framework/yiic webapp WebRoot/testdriveyiic是脚本文件,webapp表示生成网站应用,后面就是网站放置的路径了3、然后开始配置虚拟主机 gvim /etc/apache2/sites-enabled/000-default4、添加一个虚拟主机,添加一下代码,这是用域名配置虚拟主机 1 <Vir... 阅读全文
posted @ 2013-01-17 11:25
linksgo2011
阅读(230)
评论(0)
推荐(0)