php. array_merge() array_merge_recursive() . implode() . .
array_merge()
php . . , . , , .
, . .
, color, 2 4, a, b. shape => trapezoid 4. . green.
:
Array
(
[color] => green
[0] => 2
[1] => 4
[2] => a
[3] => b
[shape] => trapezoid
[4] => 4
)
, php.
, , 3. . :
array(5) {
[0]=>
string(6) "zero_a"
[2]=>
string(5) "two_a"
[3]=>
string(7) "three_a"
[1]=>
string(5) "one_b"
[4]=>
string(6) "four_b"
}
array_merge_recursive()
array_merge_recursive()
php. . , array_merge(). , , .
. , favorite, . 5, 10 . color => array(...) , 5 10. blue , red green. :
Array
(
[color] => Array
(
[favorite] => Array
(
[0] => red
[1] => green
)
[0] => blue
)
[0] => 5
[1] => 10
)
implode()
php , implode(). :
string implode ( string $glue , array $pieces )
$glue , . $pieces , . , $glue. :
$pieces[0] . $glue . $pieces[1] . $glue . $pieces[2]
implode() explode(), .
'', '' '' $comma_separated. ",". “,,”.
php - :
- array_merge();
- array_merge_recursive();
- implode().
, . , . , . , . , .
implode() . , .