开发中经常用到的代码

[TOC] 短链接 http://surl.sinaapp.com/引入百度CDN公共库 地址:http://t.cn/zYDC8wj引入文件 <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <script src="http://libs.baidu.com/bootstrap/2.0.4/js/bootstrap.min.js"></script> <link href="http://libs.baidu.com/bootstrap/2.0.4/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquerytools/1.2.7/jquery.tools.min.js"></script> PHP //申明页面编码开启session并设置时区 session_start(); header("Content-Type: text/html; charset=UTF-8"); ini_set('date.timezone','Asia/Shanghai'); // //windows下这个页面执行时间还是在php.ini里控制,修改max_execution_time。 set_time_limit(0); //获取变量的整数值 intval('adasdasd'); //heredoc==双引号 $name=MyName; echo <<<EOT My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should print a capital 'A': \x41 EOT; /* 以上例程会输出: My name is "MyName". I am printing some Foo. Now, I am printing some Bar2. This should print a capital 'A': A */ //Nowdoc==单引号 echo <<<'EOT' My name is "$name"....

March 3, 2014 · 4 min · Me