Home  >  Article  >  Backend Development  >  学习php过程中的一些注意点的总结_PHP

学习php过程中的一些注意点的总结_PHP

WBOY
WBOYOriginal
2016-06-01 11:59:31739browse
1.php传值到javascript
php传值给javascript的方式:需要在标签外面打上引号
document.getElementById("titor"+a+b).innerHTML="";
注:实际上原先本人理解有错,php为动态显示语言。实际上为显示相关文本的echo里面,因为原来的不带引号,所以加引号是自然的

2.时间戳转换
strtotime可以把mysql里面的datetime转换为时间戳;

3.关于数据的四舍五入
number_format($time*$deposit_money*0.05/365,2) 后面的2表示保留小数点2位,是进行了四舍五入的。另外一种方式echo sprintf("%.2f", $number);不进行四舍五入

1.GRANT和REVOKE命令:
授予和取消mysql用户的权限,权限分为四个级别全局——数据库——表——列

2.创建索引
可以使查询变得更快 create index语句

3.检索变量
$_POST $_GET $_REQUEST

4.heredoc语法
echo line 1
line 2
line 2
theEnd
theEnd内的东西都被当作字符串处理
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn