php while 与do while的区别
本教程来讲一下关于在php编程中常用到的循环语句do while与while的区别吧,while 是当条件为真是才执行而do while至少会执行一下,下面我们就来看看
do {
}while(条件)
看do while的实例吧。
<?
$a =10;
do {
echo $a;
}while ($a>11)
这里会输出10;然后循环终止,那么我们来看看while的实例吧。
$a=10;
while($a>11){
echo $a;
}
这里不会有任何输出,现在各位明白是什么意思了吧。
相关文档:
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
<?php
set_time_limit(0);
$url='http://item.taobao.com/auction/item_detail.htm?xid=0db2&item_num_id=4512430274&cm_cat=50000671&pm2=1';
$ch = curl_init();
$timeout = 10;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CU ......
header("Content-Type:text/html;charset=utf8"); 放到PHP开头处
$link=mysql_connect("localhost","root","110110");//链接
mysql_select_db("blog",$link);//选择数据库
mysql_query("SET character_set_results=gbk", $link);//字符编码 ......
从php5.10开始,php中加入了时区的设置,在php中显示的时间都是格林威治标准时间,这就造成了我们中国的用户会差八个小时的问题!
相关设置是修改php.ini中的 date.timezone 参数:
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
默认是关闭的,只需把注释去掉,改为即可
[Dat ......