function to get post/page slug

When coding or styling a theme, it can be very useful to be able to get the slug of the current post or page, for example to create a css class. Here’s an easy function to get the slug from the current post or page.

source : http://www.wprecipes.com/wordpress-function-to-get-postpage-slug