testing for the type

  • ctype_alnum()
  • is_numeric()
  • is_finite()
  • is_infinite()
  • is_nan()
  • gettype()
  • is_int()
  • is_integer()
  • is_long()
  • is_double()
  • is_float()
  • is_real()
  • is_bool()
  • is_null()
  • is_string()
  • is_array()
  • is_object()
  • is_resource()

Validate Numeric Variables

Finds whether a variable is a number (or a numeric string). This string would result in a TRUE.

+0123.45e6

Example of usage:

if ( strlen($cost) > 0 and !is_numeric($cost)) {$isAnomaly = true; }
Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Coding, PHP Data Value Types, PHP Form Processing and tagged , . Bookmark the permalink.

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s