Create WordPress Admin Menu Plugin

I am learing about “How to develop wordpress plugin”. In this tutorial i will give some information about “How to add wordpress plugin menu in admin menu list”. I did it using function and class. I added my sourcecode below.

Create [Plugin] Admin Menu Using Class

<?php
/** class ***/
class bscode_my_plugin_loader{    
    function bscode_my_plugin_loader(){
        add_action('admin_menu',array(&$this,'bscode_top_level_menu'));
    }
    function bscode_top_level_menu(){
        add_menu_page(
            'BSCODE Title',//title
            'BSCODE Menu',//Menu Title
            8,//Minimum capability required to view the menu
            'bscode_top_menu_url',//menu slug
            array(&$this,'bscode_menu_page_content'),// display content function
            plugins_url("/arrow.png",__FILE__), // icon for menu
            1// Menu Position from top            
        );
    }
    function bscode_menu_page_content(){
        echo "Welcome to wordpress menu development page";
    }
}
$bscodeobject=new bscode_my_plugin_loader();
?>

Create [Plugin] Admin Menu Using Function [Without class]

<?php
add_action('admin_menu','bscode_top_level_menu');

function bscode_top_level_menu(){      
    add_menu_page(
		'BSCODE Title',//title
        'BSCODE Menu',//Menu Title
        8,//Minimum capability required to view the menu
		'bscode_top_menu_url',//menu slug
		"bscode_menu_page_content",// display content function
		PRO_URL."/png.png",// icon for menu
        2 // menu position from top
	);
}

function bscode_menu_page_content(){
    echo "Welcome to wordpress menu development page";
}
?>