PHP numeric judgment Function

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.