in_array,trim,isset,unset,is_numeric function usage in PHP array

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags array echo function functions how to how to use is_numeric it is

PHP in_array,trim,isset,unset,is_numeric function usage.

Let's take a look at the tutorial on how to use these functions.

In_array ($array)

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

EX:

$array = Array (1,2);
if (In_array ($array))
{
Die (' In_array judged it to be an array ');
}
Echo ' is not an array ';

Result:

In_array judged it to be an array of


Trim ($value)


The TRIM function is to remove null values for parameters including NULL, ""

Isset ($value)

Isset is to determine whether a variable exists

Unset ($value)

Destroying variables

Let's look at the isset,unset example.

$a = ' V ';

Isset ($a)? $a: NULL;

unset ($a);

Isset ($a)? $a: NULL;

The result:

V

Null

Is_numeric ($num)

$num = 3;

if (Is_numeric ($num))
{
Echo $num;
}
Else
{
Echo ' is not a value ';
}

Related Article

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.