首页>itarticle>php basicSingle quote vs double quoteIterator in phpType ConversionRequire vs includeIsset vs empty vs isnullSome Utility Sample Iterator in php Type Conversion Require vs include Isset vs empty vs isnull Some Utility Sample
php basicSingle quote vs double quoteIterator in phpType ConversionRequire vs includeIsset vs empty vs isnullSome Utility Sample Iterator in php Type Conversion Require vs include Isset vs empty vs isnull Some Utility Sample
admin11月 11, 20200
The double quote could have the variable inside.
Iterator in php
Use glob to get file names in the system.
Use array_map function to call a function multiple times, every time one element will be assign as parameter.
Use array_reduce function to call a function iteratively, reduce the array to single value.
Use array_merge function to override default value in array (e.g. extend/override configuration).
Use array_fill_keys to assign same value to all the elements in an array
Use array_filter to remove the empty value.
Type Conversion
Require vs include
require is identical as include, except it can throw error when failure.
require_once will check if the file has already been included.
Isset vs empty vs isnull
isset return true when the variable is not null
empty return true when the variable is an empty string / false / array() / null / 0 and a unset value.
isnull is opposite as isset, return true when null
近期评论