title: Pass object through NodeJS to PHP
body: <p>I´m trying to pass object with two keys/values and I want to read it on the other side when I make Apache connect to it.</p>
  
  <p>My nodejs server looks like so:</p>
  
  <pre><code>var sWeather = {"url1": "something", "url2": "another"};
  var oWeather = JSON.stringify(sWeather);
  console.log(sWeather);
  
  
  var http = require('http');
  http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end(sWeather+'\n');
  }).listen(1340, '#');
  console.log('Server running at http://###/');
  </code></pre>
  
  <p>Now I´m really new to nodejs and I have tried alot of thing so I´m not sure if I need to stringify the <code>sWeather</code> before I send it away.</p>
  
  <p>My PHP file is like so:</p>
  
  <pre><code>&lt;?php
  $responseFromNode = file_get_contents("IP address");
  var_dump($responseFromRuby);
  </code></pre>
  
  <p>For now I get <code>string '[object Object]</code> on my webpage because of <code>var_dump</code>.</p>
  
  <p>I've tried doing something like </p>
  
  <pre><code>$url1 = $responseFromNode-&gt;url1
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$url1 = $responseFromNode['url1']
  </code></pre>
  
  <p>I would just like to access both of the urls as a string so I can store it.</p>
  
  <p>Any tips would be highly appreciated.</p>