1

I want to only get the value show below in float, how to do it.

 array (size=1)
'USD_PKR' => float 123.150375

But this output came after running following line.

var_dump($obj);

So I want to only get

123.150375

SO how to fetch only float value.

1 Answer 1

1

Just access the 'USD_PKR' key in the $obj array. You can typecast it to float datatype using (float).

Check the following:

$value = (float)$obj['USD_PKR'];
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks.... I had tried but that time it said you can accept answer after 10 minutes :) Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.