While debugging, it would help if I could exit() and use a foreach to print individual elements of an array. Any ideas?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to easily print the contents of an array or any other PHP value, use
var_dump. Callingexit()is orthogonal to this, and I think it’s quite clear to write:Another technique is to log your output, which is potentially more useful if you don’t want to sift through your output HTML to look for the output of
var_dump: