Thread:Project:Support desk/$output- query results into an array (2)/reply (4)

> how to I use print_r; in an extension inorder to show the results of an array on the page Basically: never :) You never output anything in your code directly (using print, print_r, echo or something else). You ever use the Class OutputPage to add Content to the output of the page. So, if you want to add some html code, you simply get the instance of OutputPage (e.g. $wgOut) and use addHTML: $wgOut->addHtml( 'HTML-Content' );

Depending on which hook you used to run your extension functions, the output will be displayed at the point the hook runs (in OutputPage-output). See for further information: https://www.mediawiki.org/wiki/Manual:Special_pages#OutputPage-.3EaddHTML.28.29