How to stop PHP using standard form?

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
branty1970
Forum Newbie
Posts: 2
Joined: Wed Jul 23, 2008 12:41 pm

How to stop PHP using standard form?

Post by branty1970 »

I have a database with some codes in it such as 9t3 or 9e2. When I echo out the result of a query that is 9e2 PHP thinks this is a number in standard form and converts it. How can I stop it doing this and make it display 9e2?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: How to stop PHP using standard form?

Post by VladSun »

Code: Select all

echo (string)$value;
// or
echo strval($value);
 
There are 10 types of people in this world, those who understand binary and those who don't
branty1970
Forum Newbie
Posts: 2
Joined: Wed Jul 23, 2008 12:41 pm

Re: How to stop PHP using standard form?

Post by branty1970 »

Thank you - worked a treat.
Post Reply