When I echo var_dump($_variable), I get one long, wrapping line with all varable's and values like
["kt_login_user"]=> string(8) "teacher1" ["kt_login_id"]=> string(3) "973" ["kt_campusID"]=> string(4) "9088" ["kt_positionID"]=> string(1) "5"
Is there a way I can make each value display on its own line for ease of reading? Something like this:
["kt_login_user"]=> string(8) "teacher1"
["kt_login_id"]=> string(3) "973"
["kt_campusID"]=> string(4) "9088"
["kt_positionID"]=> string(1) "5"
I usually have a nice function to handle output of an array, just to pretty it up a bit when debugging.
Then just call it
Or if you have an editor like that saves snippets so you can access them quicker instead of creating a function for each project you build or each page that requires just a quick test.
For
print_r
:For
var_dump()
:I use the above with PHP Storm. I have set it as a
pr
tab command.var_export will give you a nice output. Examples from the docs:
Will output: