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;
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.