Facebook uses PHP but you could also use other web programming languages like Python or Ruby (on Rails) etc and get similar results.
Facebook is many programming languages put together. There's PHP, Javascript, Java, MySQL (core of their database), Python, and even more. Don't forget the languages for their apps (iPhone, Android, PCs) which include C, C++, C#...
Facebook is really complex man! Even google's homepage which appears pretty basic uses multiple programming languages.