<?php

	echo fbUser( 'http://f...content-available-to-author-only...k.com/walterwhite' ).PHP_EOL;
	echo fbUser( 'http://w...content-available-to-author-only...k.com/roberval' ).PHP_EOL;
	echo fbUser( 'http://w...content-available-to-author-only...k.com/profile.php?id=xxxxx').PHP_EOL;
	echo fbUser( 'http://www.google.com/search').PHP_EOL;

	function fbUser( $url ) {
	    preg_match('~^https?://(www.)?facebook.com/(profile\.php\?id=)?(.*)~',$url,$matches);
	    return $matches[3];
	}