Skip to content
Zimo Xiao edited this page Mar 4, 2018 · 11 revisions

is::mobile

  • Name:

    mobile - check whether the user's agent is a computer or a mobile phone
  • Synopsis:

    is::mobile()
  • Description:

    • transform the user's agent string into lower letters then check if it contains 'mobile', 'android', or 'phone' to determine what agent the user is using
    • is::mobile();//true if user is using a phone

is::empty

  • Name:

    empty - Check if anything is empty
  • Synopsis:

    is::empty($input)
  • Description:

    • accept an array or a string and return a boolean
    • If the user inputs an array, function will check if $_FILES is empty or array as whole is empty or any array item is empty
    • If the user inputs a string, function will check if the string is an empty string
    • is::empty($array_file_or_str);
      //true if []/['','']/''/0 or $_FILES['a_file'] does not exists
    • return false if $in_p is not an array or a string

is::ary

  • Name:

    ary - Judge if the input is an array
  • Synopsis:

    is::ary($your_array)
  • Description:

    • is::ary($array);//true if $array is an array

is::str

  • Name:

    str - Judge if the input is a string
  • Synopsis:

    is::str($str)
  • Description:

    • is::str($str);//true if $str is a string

is::int

  • Name:

    int - Judge if the input is an integer
  • Synopsis:

    is::int($int)
  • Description:

    • is::int($int);//true if $int is an integer

is::float

  • Name:

    float - Judge if the input is a float
  • Synopsis:

    is::float($float)
  • Description:

    • is::float($float);//true if $float is a float

is::regex

  • Name:

    regex - check if the input matches a regular expression
  • Synopsis:

    is::regex($input)
  • Description:

    • is::regex($input);//true if $input is a regular expression
    • return true if the input matches a regular expression and return false otherwise

is::in

  • Name:

    in - Check if $part is a part of $full
  • Synopsis:

    is::in($part, $full)
  • Description:

    • is::in($part,$full);//true if $part is a part of $full
    • accept two parameters and return true if the first parameter is a part of the second parameter
    • If $full is an array, function will loop over $full and check if $part is a part of a value in the array
    • If $full is not an array and $part is a regular expression, function will check if $part and $full perform a regular expresssion match
    • If $full is not an array and $part is not a regular expression, function will assume they are strings and check if $part is a substring of $full

is::url

  • Name:

    url - check if any url is in the input string and return the url if ther are any
  • Synopsis:

    is::url($url)
  • Description:

    • is::url($url)//return the url if true and false if there's no valid url

is::dir

  • Name:

    dir - check if the input string has an directory and return the directory if there are any
  • Synopsis:

    is::dir($dir)
  • Description:

    • is::dir(string $dir)//true if directory exist

is::email

  • Name:

    email - check if the input string has an email and return the email if there are any
  • Synopsis:

    is::email($email)
  • Description:

    • is::email($email);
      //if true, return the email, otherwise return false

is::multi_layer

  • Name:

    multi_layer - check if an array is multidimensional
  • Synopsis:

    is::multi_layer($array)
  • Description:

    • is:: multi_layer([1,2,[3,4],5]);
      //if true array contains arrays

Getting Started

Data Structure

Networking

Operations

Features

Clone this wiki locally