title: Warning: fgets() expects parameter 1 to be resource, string given in
body: <p>I am somewhat new to php, but I do understand some of the key concepts of it, however nothing about STDIN, what it is and why I am getting this error.</p>
  
  <p>I am developing with the eTrade API PHP SDK and the development community over there seems to be a ghost-town, and absolutely nothing here on stackoverflow.</p>
  
  <p>Here is the result of the php script I am trying to run
  <a href="http://philiparudy.com/etrade/Samples/test_market.php" rel="nofollow">http://philiparudy.com/etrade/Samples/test_market.php</a></p>
  
  <p>I guess I am confused about this simple sample script that they give you where the end of the php script looks like this:</p>
  
  <pre><code>function get_input($str)
  {
   echo "\nPlease enter * $str * : ";
   return trim(fgets(STDIN));
  }
  function show_menu()
  {
   echo "\n\nChoose from following options..\n\n";
   echo "1. Get Option Chain\n\n";
   echo "2. Product Lookup\n\n";
   echo "3. Get Expiry Dates\n";
   echo "4. Get Quote\n";
   echo "0. Exit\n";
   echo "Enter your choice:";
   $choice = trim(fgets(STDIN));
  return $choice;
  }
  </code></pre>
  
  <p>Above all of this is a switch function that is supposed to handle your input, but there is no place to put the input on the webpage?</p>
  
  <p>I also tried copying and pasting this in the terminal to which I got an array of different errors. Am I missing the boat completely here?</p>