In joomla development, many times you will need to know if you are in admin area or the site area. Because of many reasons, sometimes I want to know to access the right folder from joomla base or know what type of current user. As it is a very popular coding part, I will share you a very easy way what all of joomla programmers use it.
Let ‘s use this part of code anywhere in your project
$app =& JFactory::getApplication();
if ($app->isSite()) echo 'Joomla front end site';
if ($app->isAdmin()) echo 'Joomla administrator';