Page 1 of 1

how do i convert a flaot in a string to a float value?

Posted: Tue Feb 03, 2004 4:52 am
by pelegk2
i have a string like this : "12354.123"
and i want to convet it to a float value!
how do i do that?
thanks in advance
peleg

Posted: Tue Feb 03, 2004 6:39 am
by JayBird

Code: Select all

<?php
$variable = '122.34343';
$variable = (float)$variable;
?>
Mark

Posted: Tue Feb 03, 2004 7:18 am
by pelegk2
thanks alot:)
but how do i do the same but from float to string?

Posted: Tue Feb 03, 2004 7:23 am
by patrikG
Have a look at Type Juggling.