TEST KAYA - 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 TEST KAYA.php

  1. <?php
  2. $a_all_f = array(
  3.         'US' => 0,
  4.         'EU' => 0,
  5.         'TAO' => 0
  6. );
  7.  
  8. $a_common_f = $a_all_f;
  9.  
  10. $a = array(
  11.         0 => array(
  12.                 'p-sku'          => 'ABC123',
  13.                 'p-cat'          => 'MANETTE',
  14.                 'p-mapping' => array(
  15.                         'US' => 1,
  16.                         'EU' => 2
  17.                 )
  18.         ),
  19.         1 => array(
  20.                 'p-sku'          => 'DEF456',
  21.                 'p-cat'          => 'MANETTE',
  22.                 'p-mapping' => array(
  23.                         'TAO' => 1
  24.                 )
  25.         ),
  26.         2 => array(
  27.                 'p-sku'          => 'OOO111',
  28.                 'p-cat'          => 'ACCESSORY',
  29.                 'p-mapping' => array(
  30.                         'US' => 3,
  31.                         'TAO' => 1
  32.                 )
  33.         ),
  34.         3 => array(
  35.                 'p-sku'          => 'PPP222',
  36.                 'p-cat'          => 'ACCESSORY',
  37.                 'p-mapping' => array(
  38.                         'US' => 3,
  39.                         'TAO' => 1
  40.                 )
  41.         )
  42. );
  43.  
  44. foreach(array_intersect_key(array_keys($a_common_f), array_keys($a[0]['p-mapping'])) as $key) {
  45.     var_dump($key);    
  46. }
  47.  
File Description
  • TEST KAYA
  • PHP Code
  • 05 May-2022
  • 719 Bytes
You can Share it: