New users ask old related questions: How to Debug PHP code-php Tutorial

Source: Internet
Author: User
Tags php debug
New users ask the old question: What is PHP code used for debugging? What tools are used for PHP code debugging? Var_dump & nbsp; is there any simpler way to use var_dump? I am a newbie. please be sure to give a detailed answer. Thank you very much. ------ Solution ------------------ 1. check the error log. 2. the new user asks the old question: What is PHP code used for debugging?
What tools are used for PHP code debugging? I have mentioned var_dump on the Internet, but I don't know how to use it. is there any simpler method?

I am a newbie. please be sure to give a detailed answer. Thank you very much.


------ Solution --------------------
1. check the error log, which is also the most direct
2. forcibly intercept var_dump (); exit;
3. php debug
------ Solution --------------------
Echo/print_r/var_dump () are commonly used.

Then enable the php error prompt function.
------ Solution --------------------
Always use
Echo'
';
Print_r ($ var );
How can this problem be solved?
------ Solution --------------------
Debugging ?? I don't know what development tool you are using. beginners use notepad to run the written webpage. if it is not the desired result, you can echo it to the simplest! In general, the SQL statement will write an error, so you can echo the SQL statement and put the result in the database for running to see where there is a mistake.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.