if ($num == (int) $num) { // It's whole } else { // It's not }
Home » Posts » Professional Pathways » Software Engineering How to Tell if a Number Is Whole in Php Jul 7, 2012 · 1 min if ($num == (int) $num) { // It's whole } else { // It's not } Related posts Filter Some Keys in Multi Dimensional Arrays in Php Apr 22, 2012 MySQL Update If Exist Else Insert Procedure Apr 22, 2011 Codeigniter Creates a New Session With Each Page Load Sep 7, 2010 Reply to this post by email · Subscribe via RSS « Prev OpenShift Error: Layer 7 Wrong Status, Invalid Response Next » 2012 Vegas