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.



Your result can be seen below.

Result of php executing





Full code of dd.php

  1. <?php
  2.         $array1 = [
  3.             0 => [
  4.                 'category_name' => 'Example 1'
  5.             ],
  6.             1 => [
  7.                 'category_name' => 'Example 2'
  8.             ],
  9.             2 => [
  10.                 'category_name' => 'Example 3'
  11.             ],
  12.         ];
  13.         
  14.         $array2 = array_fill(0, count($array1), ['import_id' => 10,
  15.                 'country_id' => 1]);
  16.                 $array2 = array_replace_recursive($array2, $array1);
  17.         print_r($array2);
  18.         
File Description
  • dd
  • PHP Code
  • 24 Apr-2020
  • 497 Bytes
You can Share it: