PHP调试及代码诠释

WBOY
Release: 2016-06-13 13:11:26
Original
986 people have browsed it

PHP调试及代码注释

一、调试
PHP调试不同于Java

1,常用调试方法:

echo  输出一个或者多个字符串

var_dump()     只适合打印变量和小数据

count()           数组长度    -------  适合打印大数据量(比如数组),只输出数量
strlen()           字符串长度

print_r()          可以打印出复杂类型变量的值(如数组,对象)

还要结合exit来使用。


2,加调试

error_reporting(E_ALL);

二、代码注释
使用/*{{{ */  和 /*}}}*/,可以通过zc和zo关闭或打开一段代码块

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template