The problem is that $price return nothing.
I'm using https://github.com/PHPGangsta/GoogleAuthenticator for the TOTP part of the code.
I have tried to play around with settype() for the $price, but seems like it doesn't really work.
If I change $obj->data->prices[0]->price to $obj->data. I get this error
Catchable fatal error: Object of class stdClass could not be converted to string in
<?php
$secret ="(Verify Secret)";
$api = "(API Key)";
require_once 'GoogleAuthenticator.php';
$ga = new PHPGangsta_GoogleAuthenticator();
$oneCode = $ga->getCode($secret);
$itemName=str_replace(array(' ','"','\'','\\\'','\\'),array('%20',null,null,null,null),$_GET['name']);
$url = "https://bitskins.com/api/v1/get_item_price/?api_key=" . $api . "&code=" . $oneCode . "&names=" . $itemName . "&delimiter=!END!";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$obj = curl_exec($curl);
$obj = json_decode(curl_exec($curl));
curl_close($curl);
$price = $obj->data->prices[0]->price;
echo "Price: ".$price."<br>";
echo "itemName: ".$itemName."<br>";
echo "url: ".$url;
?>