I need to get the current page id in WordPress plugin page outside the loop. And the code I wrote for getting current page id is in my plugin page.
page id
You get see all of the settings and variables in get_defined_vars() function:
get_defined_vars()
var_dump(get_defined_vars());
In your case you need to get '_GET' and inside 'post'... The code should look like this:
$tmp = get_defined_vars(); var_dump($tmp['_GET']['post']);