• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 435
  • Last Modified:

Retrieve values from PHP array

I am trying to do a basic calculation in PHP, but I am getting an incorrect result.  I am trying to retrieve a number from an array, but for some reason it appears that the number returned is missing all of the digits after the comma.

For example, I am trying to retrieve 53,932 from the array, but when I cast using
(int)

Open in new window

the number returned is only 53.

Do I need to cast the value as an integer before trying to retrieve it from the array?
0
DanielAttard
Asked:
DanielAttard
1 Solution
 
DanielAttardAuthor Commented:
I solved this issue by using the following:

doubleval(str_replace(",","",$cur_rs_TCTQ_phasein_band1[$ak[$i]][$k['CAT']][$k['TC']][$k['TQ']]))

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now