Теоретические задания | Практические задания
+
- "объединение" массивов+
vs array_unique(array_merge($a, $b))
==
- равенство===
- тождественное равенство (массивы содержат пары ключ/значение в одинаковом порядке и одного типа)!=
/ <>
- неравенство массивов!===
- тождественное неравенство<?php
$a = array("apple", "banana");
$b = array(1 => "banana", "0" => "apple");
$c = array(1 => "banana", 0 => "apple");
var_dump($a == $b); // bool(true)
var_dump($a === $b); // bool(false)
var_dump($a == $c); // bool(true)
var_dump($a === $c); // bool(false)
var_dump($c == $b); // bool(true)
var_dump($c === $b); // bool(true)
var_dump($a == $b); // bool(true)
var_dump($a === $b); // bool(false)
var_dump($a == $c); // bool(true)
var_dump($a === $c); // bool(false)
var_dump($c == $b); // bool(true)
var_dump($c === $b); // bool(true)
Полный список функций доступен в документации.
array explode ( string $delimiter , string $string [, int $limit ] )
string implode ( string $glue , array $pieces )
string implode ( array $pieces )
array array ([ mixed $... ] )
array range ( mixed $start , mixed $end [, number $step = 1 ] )
array array_fill(int $start_index, int $num, mixed $value)
array array_fill_keys(array $keys, mixed $value)
array array_combine ( array $keys , array $values )
array array_pad ( array $input , int $pad_size , mixed $pad_value )
array array_values ( array $input )
array array_keys (array $input [, mixed $search_value = null [, bool $strict = false]])
bool in_array ( mixed $needle , array $haystack [, bool $strict = false ] )
mixed array_search ( mixed $needle , array $haystack [, bool $strict = false ] )
bool array_key_exists ( mixed $key , array $search )
int count ( mixed $var [, int $mode = COUNT_NORMAL ] )
/ sizeof / Countablearray array_count_values ( array $input )
number array_sum ( array $array )
array array_merge ( array $array1 [, array $... ] )
array array_merge_recursive ( array $array1 [, array $... ] )
array array_unique ( array $array [, int $sort_flags = SORT_STRING ] )
array list ( mixed $varname [, mixed $... ] )
array compact ( mixed $varname [, mixed $... ] )
int extract ( array &$var_array [, int $extract_type = EXTR_OVERWRITE [, string $prefix =null ]] )
int array_push ( array &$array , mixed $var [, mixed $... ] )
mixed array_pop ( array &$array )
int array_unshift ( array &$array , mixed $var [, mixed $... ] )
mixed array_shift ( array &$array )
array array_flip ( array $trans )
array array_change_key_case ( array $input [, int $case = CASE_LOWER ] )
array array_map ( callable $callback , array $arr1 [, array $... ] )
number array_product ( array $array )
mixed array_reduce ( array $input , callable $function [, mixed $initial = NULL ] )
array array_replace ( array $array , array $array1 [, array $... ] )
array array_replace_recursive ( array $array , array $array1 [, array $... ] )
array array_chunk ( array $input , int $size [, bool $preserve_keys = false ] )
array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = false ]] )
array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )
array array_filter ( array $input [, callable $callback = "" ] )
mixed current ( array &$array )
/ posarray each ( array &$array )
mixed end ( array &$array )
mixed key ( array &$array )
mixed next ( array &$array )
mixed prev ( array &$array )
mixed reset ( array &$array )
bool array_walk_recursive ( array &$input , callable $funcname [, mixed $userdata = null ] )
bool array_walk ( array &$array , callable $funcname [, mixed $userdata = null ] )
arrayudiffuassoc — Computes the difference of arrays with additional index check, compares data and indexes by a callback function
array_intersect — Computes the intersection of arrays
arrayintersectassoc — Computes the intersection of arrays with additional index check
arrayintersectuassoc — Computes the intersection of arrays with additional index check, compares indexes by a callback function
arrayintersectkey — Computes the intersection of arrays using keys for comparison
arrayintersectukey — Computes the intersection of arrays using a callback function on the keys for comparison
array_uintersect — Computes the intersection of arrays, compares data by a callback function
arrayuintersectassoc — Computes the intersection of arrays with additional index check, compares data by a callback function
arrayuintersectuassoc — Computes the intersection of arrays with additional index check, compares data and indexes by a callback functions