title: Extract string from API request does not work
body: <p>So I am trying to code a .php file that should extract a string from an API call (example of text to be extracted here: <a href="https://gyazo.com/1efffc2360bd6aba15ece3437251aebd" rel="nofollow">https://gyazo.com/1efffc2360bd6aba15ece3437251aebd</a>)</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;?php
  $item = $_GET['item'];
  $item = str_replace("\"", "", $item);
  $item = str_replace("\'", "", $item);
  $item = str_replace(" ", "%20", $item);
  $item = str_replace("\\", "", $item);
  @include_once ("pdocon.php");
  $stmt = $dbh-&gt;prepare("SELECT * FROM items WHERE name=?");
  $stmt-&gt;execute(array($item));
  $rs = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  if(!empty($rs)) {
          if(time()-$rs["lastupdate"] &lt; 604800) die($rs["cost"]);
  }
  $link = "https://bitskins.com/api/v1/get_item_price/?api_key=(NOTSHOWINGYOUGUYSMYAPIKEY)&amp;names=".$item;
  $string = file_get_contents($link);
  $json = $string;
  
  $obj = json_decode($json);
  //print $obj-&gt;{"median_price"}; // 12345
  //$obj = json_decode($string);
  if($obj-&gt;{'status'} == "success") die("notfound");
  $lowest_price = $obj-&gt;{'price'};
  $lowest_price=str_replace("$", "", $lowest_price);
  $lowest_price = (float)($lowest_price);
  
  //$stmt = $dbh-&gt;prepare("DELETE FROM items WHERE name=?");
  //$stmt-&gt;execute(array($item));
  $stmt = $dbh-&gt;prepare("UPDATE items SET `cost` = ?,`lastupdate` = ? WHERE `name` = ?");
  $stmt-&gt;execute(array($lowest_price, time(), $item));
  $stmt = $dbh-&gt;prepare("INSERT INTO items (`name`,`cost`,`lastupdate`) VALUES (?, ?, ?)");
  $stmt-&gt;execute(array($item, $lowest_price, time()));
  echo $lowest_price;
  ?&gt;
  </code></pre>
  
  <p>The problem is that the code does not extract the string I need (the $lower_price variable). I tried running it by defining the $item variable myself in hash market name value format and also by using the displayed script. No result. Any idea why?</p>
  
  <p>Thanks.</p>