Solved

Retrieve values from PHP array

Posted on 2014-01-19
1
426 Views
Last Modified: 2014-01-19
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
Comment
Question by:DanielAttard
1 Comment
 

Accepted Solution

by:
DanielAttard earned 0 total points
ID: 39793213
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question