Never had to do such a basic thing before. How do I initialize a variable as a float before doing logic? Do either of these examples make sense?
$var = 0.0;
$var = (float) 0;
Both make sense, the first is shorter, with the second you can initialized with a dynamic value, your choice !
EDIT : But I agree with @Niet the Dark Absol, it poorly matters since you use test function such as ctype_digit, or is_numeric.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With