dd - 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 dd.php
- <?php
- $array1 = [
- 0 => [
- 'category_name' => 'Example 1'
- ],
- 1 => [
- 'category_name' => 'Example 2'
- ],
- 2 => [
- 'category_name' => 'Example 3'
- ],
- ];
- $array2 = array_fill(0, count($array1), ['import_id' => 10,
- 'country_id' => 1]);
- $array2 = array_replace_recursive($array2, $array1);
- print_r($array2);