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