printing value of variable for debugging

printing value of variable for debugging

Chirag Patel -
Vastausten määrä: 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!

 

Arviointien keskiarvo: -
Vastaus Chirag Patel

Re: printing value of variable for debugging

Jez H -

$havemanage = array_keys($havemanage);

print_r($havemanage);

die();

 

 

Arviointien keskiarvo:Useful (1)
Vastaus Jez H

Re: printing value of variable for debugging

Tim Hunt -
Kuva: Core developers Kuva: Documentation writers Kuva: Particularly helpful Moodlers Kuva: Peer reviewers Kuva: Plugin developers

Or, in Moodle

print_object($whatever)

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

Arviointien keskiarvo:Useful (2)