Assigning a return (value) to a new variable
<p>Thanks for all your quick responses! Although the code below looks like I want to print the values to be viewed on-screen I need the values eg. $user_profile [email] in another function (to register new wordpress user). Below is the complete code. How do I do this? </p>

<pre><code>&lt;?php
try{
include_once "src/fbaccess.php";
}catch(Exception $e){
error_log($e);
}
try{
require_once "wp-blog-header.php";
}catch(Exception $e){
error_log($e);
}

try{
require_once "wp-includes/registration.php";
}catch(Exception $e){
error_log($e);
}

?&gt;

&lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
    &lt;title&gt;Florian's Facebook login&lt;/title&gt;    

&lt;/head&gt;
&lt;body&gt;
&lt;!-- Copy the below code to display FB Login/Logout button --&gt;
&lt;?php if ($user): ?&gt;
  &lt;a href="&lt;?php echo $logoutUrl; ?&gt;"&gt;Logout&lt;/a&gt;
&lt;?php else: ?&gt;
  &lt;div&gt;
  &lt;a href="&lt;?php echo $loginUrl; ?&gt;"&gt;Login with Facebook&lt;/a&gt;
  &lt;/div&gt;
&lt;?php endif ?&gt;
&lt;!-- Copy the above code to display FB Login/Logout button --&gt;

&lt;h3&gt;PHP Session&lt;/h3&gt;
&lt;pre&gt;&lt;?php print_r($_SESSION); ?&gt;&lt;/pre&gt;

&lt;?php if ($user): ?&gt;
  &lt;h3&gt;You&lt;/h3&gt;
  &lt;img src="https://graph.facebook.com/&lt;?php echo $user; ?&gt;/picture"&gt;

  &lt;h3&gt;Your User Object (/me)&lt;/h3&gt;
   &lt;pre&gt;&lt;?php  return ($user_profile [email]); ?&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;?php return ($user_profile [first_name]); ?&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;?php return ($user_profile [last_name]); ?&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;?php return ($user_profile [location]); ?&gt;&lt;/pre&gt;   
&lt;?php else: ?&gt;
  &lt;strong&gt;&lt;em&gt;You are not Connected.&lt;/em&gt;&lt;/strong&gt;
&lt;?php endif ?&gt;
</code></pre>
