0
Why the Code doesn't change the type?
I want to change a string into a float or null. https://code.sololearn.com/wfKlHjs8H6Xz/?ref=app
3 Answers
+ 1
you never changed $text
in validateFloat you should change last line to
$text= floatval($text);
+ 1
thx your right one mistake fixed :D
but unset doesn't work
$text = null;
also doesn't work
+ 1
ah ok i have fixed the problem
$text = NULL;
unset doesnt work in this scope