I want to get WordPress database name. I have also try to get database name from $wpdb but failed. When print the $wpdb it give an object array but i don't know how to get database name from object array.
To get the db name using
global $wpdb; echo $wpdb->dbname;
It will return database name as a string.
You can also get the database name from the constant
DB_NAME without going for