printing value of variable for debugging

printing value of variable for debugging

by Chirag Patel -
Number of replies: 2

hey guys I am getting database query like this

 

// Get the list of all users having moodle/course:manageactivities capability

// in order to take out them later from the report (to try to get "students" only).

if

 

($havemanage = get_users_by_capability($context, 'moodle/course:manageactivities', 'u.id') ){

 

$havemanage = array_keys($havemanage);

}

 

now i want to see what is inside havemanage,then How i can do that?

How can i print contents of havemanage on my moodle page,

This line is from report plugin rawrecordscount!

 

Average of ratings: -
In reply to Chirag Patel

Re: printing value of variable for debugging

by Jez H -

$havemanage = array_keys($havemanage);

print_r($havemanage);

die();

 

 

Average of ratings: Useful (1)
In reply to Jez H

Re: printing value of variable for debugging

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Or, in Moodle

print_object($whatever)

It is basically the same as print_r, but comes out formatted prettily.

Average of ratings: Useful (2)