I have access to a URL that if i simply put http://example.com/weight into address bar it returns a float number...
Ex: 17.23kg
Image for better understanding:
My objective is to use PHP for assigning this float value into a variable. $weight = float value...
Here is the code i did with hopes that it would work:
$url = 'http://example.com/weight';
$url_components = parse_url($url);
parse_str($url_components['weight'], $params);
$weight = $params['weight'];
echo $weight;
But this returned nothing...
What am i doing wrong?