If you need to test PHP between different PHP version try this online sandbox:
https://sandbox.onlinephpfunctions.com/
1 How to not get an “apple” element from the array
$a = array("a" => "apple", "b" => "banana");
- arraypop(arrayreverse($a))
- $a”a” (should it not be $a[“a”] ?)
- array_pop($a)
- find($a, ‘apple’)
2 Pick the correct answer
<?
$a = array("a" => "apple", "b" => "banana");
$b = array("a" => "pear", "b" => "strawberry", "c" => "cherry");
$c = $a + $b;
print_r($c); // what will it output?
Results:
- the keys will be duplicated
- the same-key elements in array a will be replaced with the elements of array b
- the same-key elements in array b will be replaced with the elements of array a
- we cannot add arrays
This page is under development. More content coming out soon…
Hi! A nice online php compiler (With MySQL): https://extendsclass.com/php.html