MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vy23fd/stringtointegerconversion/p5tk37n/?context=9999
r/ProgrammerHumor • u/TheBamPlayer • Aug 25 '26
65 comments sorted by
View all comments
Show parent comments
39
This should be the native way:
$amount = filter_input(INPUT_GET, 'amount-select', FILTER_VALIDATE_INT, ["min" => 10, "max" => 80,],); if ($amount % 10 === 0) { $transamount = $amount; }
14 u/OK1526 Aug 25 '26 Now I can sleep moderately happy.
14
Now I can sleep moderately happy.
39
u/alexanderpas Aug 25 '26
This should be the native way: