title: How to access php URL via curl on Mac Terminal
body: <p>I've a php file which I've hosted on some server, now I want to access the output of URL via curl like: </p>
  
  <pre><code>curl -s  http://ankur.serve.qa.vdopia.com/getTag.php?type=vanilla&amp;tag=master
  [1] 81246
  **vanilla4.9.8-2**
  </code></pre>
  
  <p>I am getting hell lot of things but the actual output which is vanilla4.9.8-2 comes little late and as soon as I hit enter after typing curl command, it just shows me the process id and goes in back ground. How do I get the output without taking the command in background.</p>
  
  <p>here is whole code of php:</p>
  
  <pre><code>header('Content-type: text/plain');
  
  $type = $_GET['type'];
  $tag = $_GET['tag'];
  
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_HEADER, 0);  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  if($type=='portal')
  {
      if($tag=='' || $tag=='master')
      {
          curl_setopt($ch, CURLOPT_URL, 'http://portal.vdopia.com/version.txt?'.uniqid());  
          $output = curl_exec($ch);  
          curl_close($ch); 
  
          echo $output;
      }
  }
  else if ($type=='vanilla')
  {
      if($tag=='' || $tag=='master')
      {
          echo 'checking';
          curl_setopt($ch, CURLOPT_URL, 'http://serve.vdopia.com/version.txt?'.uniqid());  
          $output = curl_exec($ch);  
          curl_close($ch); 
  
          echo $output;
      }
  }
  
  exit();
  </code></pre>