This is the very important thing in magento while accessing data from outside of the magento, You also can use it to set cron job of any magento function, as cron job doesn’t work properly in magento.

require_once ‘app/Mage.php’; // if your are not root folder then write the proper path like publichtml/magento/app/Mage.php
Mage::app(‘default’);
[/pre]

Now you can create object of any classes and can access methods of those classes also.

Like the Below example

 
$obj = new Mage_Checkout_Model_Observer();
echo $obj->salesQuoteSaveAfter();