PHP code for judging several commonly used numbers, including double precision, integers, and characters.
<HTML> <HEAD> <TITLE> common numeric judgment functions </TITLE> </HEAD> <BODY> <? // Determine the array $ colors = array ("red", "blue", "green"); if (is_array ($ colors) {print ("colors is an array ". "<br>") ;}// double-precision value determination $ Temperature = 15.23; if (is_double ($ Temperature) {print ("Temperature is a double ". "<br>") ;}// integer judge $ PageCount = 2234; if (is_integer ($ PageCount) {print ("$ PageCount is an integer ". "<br>") ;}// object judgment class widget {var $ name; var $ length;} $ thing = new widget; if (is_object ($ thin G) {print ("thing is an object ". "<br>") ;}// judge the string $ Greeting = "Hello"; if (is_string ($ Greeting) {print ("Greeting is a string ". "<br>") ;}?> </BODY> </HTML>Articles you may be interested in
- PHP functions for converting Arabic numerals into Chinese Characters
- PHP generates continuous numbers (letters) Array Function range () analysis, PHP lottery program function
- Common PHP variable judgment Functions
- Php's most precise String Length truncation Function
- Php function for getting the first letter of Chinese characters and Pinyin (actually usable)
- Php checks whether functions, classes, and class methods exist.
- Php's function for determining information about visiting spider
- Php reads the Directory and lists the functions that display the files in the directory.