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
It's very simple to delete an array element in PHP, but sometimes deleting an array requires some sort of index. We'll use the relevant function, and here we'll introduce the difference between using Unset,array_splice to remove elements from an
This article describes the differences among is_null, empty, isset, and unset in php. For more information, see
Is_null, empty, isset, and unset. Let's take a look at the descriptions of these four functions.
Isset determines whether a variable
The unset php of php is very special.
To put it simply:
Refer to the php manual:
array (1, 2, 3));/* Look at memory _______________________________|pointer | value | variable's | -----------------------------------| 1 |
It is very simple to delete an array element in PHP, but sometimes deleting an array requires some ordering of the index and we will use the relevant function, here we introduce the use of Unset,array_splice to delete the elements in the array of
This article mainly introduces PHP using unset () to delete a cell (key) in the array method, example analysis of the unset function in the deletion of the array unit of the use of skills, the need for friends can refer to the
This example
Echo!isset (get[′a′]); If the value of variable A is not Echoempty (_get[' a ']); If the value of variable A is null Is_null, empty, isset, unset Let's take a look at the descriptions of these 4 functions first.
Isset determine if a variable
This article describes how php uses unset () to delete a unit (key) in an array. The example shows how to use the unset function to delete an array unit, for more information about how php uses unset () to delete a unit (key) in an array, see the
Empty,isset First checks whether a variable exists , and then detects the value of the variable. and is_null Just checks the value of the variable directly, whether it is null, so if the variable is undefined, an error will occur! later:Detects if
The __set () method is used to set the private property value.
The __get () method is used to get the private property value.
The __isset () method is used to detect whether a private property value is set.
The __unset () method is used to delete
Is_null, empty, isset, unset Let's take a look at the descriptions of these 4 functions first.
Isset determine if a variable already exists (configuration)unset to remove (release) a variableEmpty determine if the variable is emptyIs_null determine
PHP has many similar functions, but there are slight differences...
Is_null, empty, isset, and unset. Let's take a look at the descriptions of these four functions.
Isset determines whether a variable already exists (configuration)Unset: delete
Use the unset () function in PHP to delete the array and then recreate the index. There are many ways to delete an array element in php, but the common method is to use the unset function. but how can we reconstruct the array index after deleting
Overloading in PHP differs from traditional object-oriented overrides, such as in Java:
class A{ public void methodName(参数1); public void methodName(参数1,参数2); public void methodName(参数1,参数2,参数3); ...}
Overloading in PHP is an "elegant"
If you want to delete an element from an array, you can use unset directly, but the index of the array will not be rearranged: The code is as follows:Copy code $ Arr = array ('A', 'B', 'C', 'D ');Unset ($ arr [1]);Print_r ($ arr );?>The result
1. The _ get and _ set methods are designed for attributes that are not declared in the class and their parent class: __get ($ property) this method is called when an undefined property is called; __ set ($ property, $ value) assigns & amp; 20540 to
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.