Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $array1 = [1, 2, 3];
- $array2 = [4, 5, 6];
- $mergedArray = $array1 + $array2;
- print_r($mergedArray);
- // Output yang akan dihasilkan:
- //Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 )
- ?>
- <?php
- $array1 = [1, 2, 3];
- $array2 = [1, 2, 3];
- if ($array1 == $array2) {
- echo "Arrays nya sama";
- } else {
- echo "Arrays nya tidak sama";
- }
- // Output: Arrays nya sama
- ?>
- <?php
- $array1 = [1, 2, 3];
- $array2 = [1, 2, 3];
- if ($array1 === $array2) {
- echo "Arrays identik";
- } else {
- echo "Arrays tidak identik";
- }
- // Output: Arrays tidak identik
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement