following is my code for php curl where i get values of currency conversion.
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "http://free.currencyconverterapi.com/api/v5/convert?q=USD_PKR&compact=y" );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec( $ch );
$json = json_decode($response, true);
print_r($json);
it gives me result
Array ( [USD_PKR] => Array ( [val] => 131.1098 ) )
I want to put 131.1098 into a variable where I will update a sql table query. Kindly advice