arrays 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 arrays test.php
- <?php
- $OPTIONS_REQUIRED_KEYS = [
- 'session' => null,
- 'game' => null,
- 'transactionId' => null,
- 'amount' => null,
- 'subType' => null,
- 'roundId' => null
- ];
- $options = [
- 'session' => 'grgrrt5655',
- 'game' => 'fthgfh8999ft',
- 'transactionId' => '7888888888',
- 'amount' => 67,
- 'subType' => 'bet',
- 'roundId' => 777888999,
- ];
- if(!array_diff_key($options, $OPTIONS_REQUIRED_KEYS)) {
- echo 'Same';
- }
- print_r(array_fill_keys($OPTIONS_REQUIRED_KEYS, $options));
- var_dump(array_diff_key($options, $OPTIONS_REQUIRED_KEYS));