php Tips

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:37:12995Durchsuche

获得服务器时间:

date_default_timezone_set('PRC'); //其中PRC为"中华人民共和国"$serverDate = date("Y-m-d G:i:s");

 

日期格式化:

$date = new DateTime('2000-01-01');echo $date->format('Y-m-d H:i:s');

可参考:http://www.w3school.com.cn/php/php_ref_date.asp
        http://php.net/manual/zh/function.date.php

返回到上一页:

//php方式header("Location: " . $_SERVER['HTTP_REFERER']);//js方式echo "<script>history.back();</script>";echo '<script>window.location="...url";</script>'; //跳转到指定页面echo '<script>self.location.reload();</script>'; //刷新当前页面


@符号:不显示错误信息(加在函数前)

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:PHP warningNächster Artikel:PHP IDE