Test - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of Test.php
- <?php
- ###################################################################
- #####TEST 1########################################################
- ###################################################################
- echo "Test 1: ";
- $array = ["apple", "", 0, 2, null, -5, "0", "orange", 10, false];
- //Remove null, false, and ""(empty string) values from the array
- echo array_values($array) === ["apple", 0, 2, -5, "0", "orange", 10] ? "OK" : "FALSE";
- ###################################################################
- #####TEST 12#######################################################
- ###################################################################
- echo "\n Test 2: ";
- $array2 = [10, 12, 33, 15, 42, 1, -5, 11, 1, 2, 4];
- //Sort an array in descending order
- rsort($array2,SORT_NUMERIC);
- echo $array2 === [42,33,15,12,11,10,4,2,1,1,-5] ? "OK" : "FALSE";
File Description
- Test
- PHP Code
- 05 Jan-2023
- 865 Bytes
You can Share it:
Latest PHP Pastes