Not a real number?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
IceMetalPunk
Forum Commoner
Posts: 71
Joined: Thu Jul 07, 2005 11:45 am

Not a real number?

Post by IceMetalPunk »

I have been using a system for money that reads a text file, and explodes it to get the user's current balance and the price of the item they are buying. It has been working so far, but suddenly it stopped working. I have traced the problem to the fact that, for whatever reason, 20 and 120 are not being recognized as real numbers (I echoed the value of the variable and is_real on both of them is coming out false).

What could cause this all of a sudden, especially when it has worked before?

-IMP ;) :)

*EDIT* I still don't know what's causing this, but I just learned that PHP can use type-casting (I'm kind of new to PHP, but I've programmed in C++, so I know what type-casting is. I just didn't know PHP could use it). So that's how I'm solving this now, but can anyone tell me what could have caused this all of a sudden?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Lets see you code.
Post Reply