Variable disappearing after adding text
<p>I was coding a cURL post request to a website login in order to retrieve a token. The script is meant to login remotely, obtain a token via preg_match and then send a GET request to another url using the preg_matched token.</p>

<p>The token comes in the form of a string e.g. ABCDEFGHIJK. In the second GET request, the token is authorized as: Authorization Bearer: ABCDEFGHIJK</p>

<p>However, upon obtaining the token from the first post request and adding in the words Authorization Bearer, the token disappears.</p>

<pre><code>&lt;?php
//Login in Remotely
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'URL');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST,           1 );
curl_setopt($ch, CURLOPT_POSTFIELDS,     'POST DATA' ); 
curl_setopt($ch, CURLOPT_HTTPHEADER,     array('Content-Type: application/json')); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!
$result = curl_exec($ch);
curl_close($ch);

//Parse Token
preg_match('#"phoenixAccessToken":"(.*)","phoenixExpiresIn#',$result,$matches);
echo $matches[1]; //This returns ABCDEFGHIJK

//Write authorization (Token returns a 0 now.)
$authorization = 'Authorization Bearer: ' &amp; $matches[1];
echo $authorization; //This returns a 0
?&gt;
</code></pre>

<p>echo $matches[1] returns the token required perfectly fine, but running echo 'Authorization Bearer: ' &amp; $matches[1]; returns a 0 instead of Authorization Bearer: ABCDEFGHIJK. </p>

<p>Why is this so? Is there anyway to fix the variable so it is static? </p>

<p>Thanks!</p>