[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Retrieve values from PHP array

Posted on 2014-01-19
1
Medium Priority
?
434 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

649 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