If you find some image file saved from Facebook, you can quickly get the users profile ID and other details from the image file name. Every image saved from a Facebook profile has a unique filename such as ‘86948_8239343856_5678_n.jpg’ (this is a dummy number).
The 2nd number from left in the filename, in this case 8239343856, which is the unique profile ID of the Facebook user.
So now the Facebook profile URL for the user is http://www.facebook.com/profile.php?id=8239343856. The following PHP script will help you get the various details like name, username, gender and locale.