Skip to content

Instantly share code, notes, and snippets.

@inalgnu
Last active August 29, 2015 14:26
Show Gist options
  • Save inalgnu/736eae0c7bc797d431c8 to your computer and use it in GitHub Desktop.
Save inalgnu/736eae0c7bc797d431c8 to your computer and use it in GitHub Desktop.
PHP WTF || it's me
<?php
$a = ['a' => '100', 'b' => '200', 'c' => '300'];
$b = ['100' => 'a', '200' => 'b', '300' => 'c'];
dump($b);
//array:3 [
// 100 => "a"
// 200 => "b"
// 300 => "c"
//]
dump(array_merge($a, $b));
//array:6 [
// "a" => "100"
// "b" => "200"
// "c" => "300"
// 0 => "a"
// 1 => "b"
// 2 => "c"
//]
dump($a+$b);
//array:6 [
// "a" => "100"
// "b" => "200"
// "c" => "300"
// 100 => "a"
// 200 => "b"
// 300 => "c"
//]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment