Phpin_array, trim, isset, unset, is_numeric function usage. -PHP source code

Source: Internet
Author: User
Phpin_array, trim, isset, unset, is_numeric function usage. Php in_array, trim, isset, unset, is_numeric function usage.

Script ec (2); script

Next, let's take a look at the tutorials on using these functions.

In_array ($ array)

This function is used to determine whether the current value is an array.

EX:

$ Array = array (1, 2 );
If (in_array ($ array ))
{
Die ('in _ array determines it is an array ');
}
Echo 'not an array ';

Result:

In_array determines it is an array


Trim ($ value)


The trim function removes the null values of parameters, including null ,""

Isset ($ value)

Isset is used to determine whether a variable exists.

Unset ($ value)

Destroy variable

Let's take a look at isset and unset instances.

$ A = 'V ';

Isset ($ )? $ A: NULL;

Unset ($ );

Isset ($ )? $ A: NULL;

The result is:

V

Null

Is_numeric ($ num)

$ Num = 3;

If (is_numeric ($ num ))
{
Echo $ num;
}
Else
{
Echo 'not a numerical value ';
}

Original site reprinted from www.111cn.net/phper/php.html

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.