用intval
while (list()=each())=foreach();
(!$aa)&&$bb = $aa or $bb;
empty($cid)&&($cid=intval($_GET['cid']))=if(empty($cid)$cid=intval($_GET['cid']);
$aa=$bb>10= if($bb>10) $aa=$bb;
对象链式调用,要求每个方法返回$this.
连字符“.“可以换行。
echo 'aaaaaa'.
'bbbbbbbbb'.
'ccccc';
设置编码header("Content-Type:text/html; charset=utf-8");
模版可以用heredoc里包含html代码
Using global keyword outside a function is not an error. It can be used if the file is included from inside a function.
常用sql语句======{{UNION,UNION ALL(在数据库中,UNION和UNION ALL关键字都是将两个结果集合并为一个,极少用) ,LEFT JOIN(最多用),INNER JOIN,JOIN,GROUP BY,SELECT COUNT(*),using(),子查询,IN,REPLACE INTO,use index();,when then else end,ifnull(),BETWEEN(极少用) ,DELETE FROM,UPDATE...SET...,SELECT FROM,INSERT INTO ...SET...,INSERT INTO ...VALUES ...,order by case... when(极少用),instr(),ALTER TABLE ,TRUNCATE TABLE ,LEFT OUTER JOIN(极少用),别名.}}
htmlspecialchars在php5.4非utf8时要加上如$encoding="gb2312"
getenv('LIB_PATH')
$_SERVER['argv']
$_SERVER['COMPUTERNAME']
$_SERVER["CONTENT_LENGTH"]
$_SERVER['DOCUMENT_ROOT']
$_SERVER['HTTP_ACCEPT_LANGUAGE']
$_SERVER['HTTP_ACCEPT_ENCODING']
$_SERVER['HTTP_ACCEPT_CHARSET']
$_SERVER['HTTP_ALBUMID']
$_SERVER['HTTP_CACHE_INFO']
$_SERVER['HTTP_CLIENT_IP']
$_SERVER['HTTP_CONNECTION']
$_SERVER['HTTP_CONTENT_DISPOSITION']
$_SERVER['HTTP_COOKIE']
$_SERVER['HTTP_HOST']
$_SERVER['HTTP_IF_NONE_MATCH']
$_SERVER['HTTP_IF_MODIFIED_SINCE']
$_SERVER['HTTP_IF_UNMODIFIED_SINCE']
$_SERVER['HTTP_ORIGIN']
$_SERVER['HTTP_PROXY_CONNECTION']
$_SERVER['HTTP_REQUEST_URI']
$_SERVER['HTTP_RANGE']
$_SERVER['HTTP_REFERER']
$_SERVER['HTTP_SCHEME']
$_SERVER['HTTPS']
$_SERVER['HTTP_USER_AGENT_VIA']
$_SERVER['HTTP_VIA']
$_SERVER['HTTP_X_REQUESTED_WITH'
$_SERVER['HTTP_X_FORWARDED_PROTO']
$_SERVER['HTTP_X_FORWARDED_FOR']
$_SERVER['HTTP_X_FORWARDED_HOST']
$_SERVER['HTTP_X_ORIGINAL_URL']
$_SERVER['HTTP_X_FLASH_VERSION']
$_SERVER['HTTP_X_REWRITE_URL']
$_SERVER['IIS_WasUrlRewritten']
$_SERVER['IIS_UrlRewriteModule']
$_SERVER['ip']
$_SERVER['LOCAL_ADDR']
$_SERVER['ORIG_SCRIPT_NAME']
$_SERVER['ORIG_PATH_INFO']
$_SERVER['PATH_TRANSLATED']
$_SERVER['PATH_INFO']
$_SERVER['PHP_SELF']
$_SERVER['PWD'];
$_SERVER['QUERY_STRING']
$_SERVER['REQUEST_METHOD']
$_SERVER['REQUEST_URI']
$_SERVER["REDIRECT_STATUS"]
$_SERVER['SERVER_PORT']
$_SERVER['SERVER_ADDR']
$_SERVER['SERVER_SOFTWARE']
$_SERVER["SERVER_PROTOCOL"]
$_SERVER['SERVER_NAME']
$_SERVER['SCRIPT_NAME']
$_SERVER['SCRIPT_URI']
$_SERVER['SCRIPT_FILENAME']
$_SERVER['sqls']
$_SERVER['time']
$_SERVER['time_today']
$_SERVER['UNENCODED_URL']
if(0){可以放注释代码}
mysql_connect($host, $username, $password,true);
windows换行:\r\n,linux换行\n.
eval可以代码加密.
header('P3P:---P3P(Platform for Privacy Preferences)(隐私权偏好选项平台)是W3C(World Wide Web Consortium)公布的一项隐私保护推荐标准。用P3P header解决iframe跨域访问cookie/session.
select count(*)=mysql_num_rows
fopen($file, 'w');
ftp函数
fsockopen
chmod(0777);
socket函数(极少次)
include(dirname(dirname(__FILE__))."/./configs/config.php");
DOMDocument
pack(),unpack()用法
return 可以返回表达式
json_encode用法
function aaa($var = OBJECT?){}
最后更新于 2022年6月26日