MyBB Community Forums

Full Version: Whats in the $mybb-> array?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just started doing a little plugin development today, and I haven't been able to find any docs on whats in the $mybb-> array? (settings, user etc)

Is there a WiKi page describing that, or maybe an easy way to print_r the array?
<?php

define("IN_MYBB", 1);
require_once "global.php";

echo "<pre>";
print_r($mybb);
echo "</pre>";

?>
Worked a charm, thanks
(2012-01-20, 09:23 PM)FlyveHest Wrote: [ -> ]or maybe an easy way to print_r the array?

Is there an easier way to print_r the array than just print_r'ing the array...? Smile
The print_r output is not html safe, so you might have to look at the page source to see the output properly. Also depending on your style the output might be centered.

I sometimes use this or something similar:

echo '<pre style="text-align: left">'.htmlspecialchars(print_r($var, true)).'</pre>';
I usually just look at the source. It's nicely formatted there.