I don't need to use {code...} because both of them are printed directly. I just like getting a string. Don't print it. How can I get it? No
Var_Dump($);print_r($ );
Because both of them are printed directly, I just like getting a string. Don't print it. How can this problem be solved?
Reply content:
No
Var_Dump($);print_r($ );
Because both of them are printed directly, I just like getting a string. Don't print it. How can this problem be solved?
Gettype (variable)
Viewing Arrays can only print
You can view the object
Get_class_methods ()
Get_class_vars ()
Gettype ()
You can also judge is_array (), is_bool (), is_float (), is_double (), is_integer (), is_null (), is_numeric (), is_object (), is_resource (), is_scalar () and is_string ()
Var str = var_export ($ arr, true );
Mixed var_export (mixed $ expression [, bool $ return])
This function returns the structure information about the variables passed to this function. It is similar to var_dump (). The difference is that the returned representation is legal PHP code.
You can set the second parameter of the function to TRUE to return the expression of the variable.
Whether it is viewing arrays, variables, or objectsVar_dump ()They are both the best tool and enough.
But I want to see the attributes and methods of the object. The answer above @ Zi ah,Get_class_methods ()AndGet_class_vars ()It will be a good method, but note thatThe two functions receive the class name..
However, you can useDebug_zval_dump ().
Of course, if you still thinkVar_dump ()Not enough. You can installXdebugExtension.