PHP common interview questions (1)

The most important thing about the success of the interview is its own hard power, but at the same time, complete preparation is also very necessary. Therefore, I collected some common interview questions from the Internet and prepared them early. What is the difference between

1, echo, print(), print_r()?

These three can be used for output and used during debugging.

The difference is that echo is a php statement, there is no return value, but print() and print_r() are functions, which can have a return value (print as long as the return value is 1, the error does not return a value); echo can print more Strings, because there is no return value, so the printing speed is the fastest; print can only print one string, and always returns 1; print_r can print composite type variables, such as arrays, objects, and so on.