Page 1 of 1

How to stop PHP using standard form?

Posted: Wed Jul 23, 2008 12:43 pm
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?

Re: How to stop PHP using standard form?

Posted: Wed Jul 23, 2008 1:17 pm
by VladSun

Code: Select all

echo (string)$value;
// or
echo strval($value);
 

Re: How to stop PHP using standard form?

Posted: Wed Jul 23, 2008 4:05 pm
by branty1970
Thank you - worked a treat.