3v4l.org

run code in 300+ PHP versions simultaneously
<?php $res = array(); foreach($yourArray as $elem) { $subArr = explode(',',$elem); foreach($subArr as &$sub) trim($sub); //remove all unwanted spacing $res = array_merge($res, $subArr); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 125) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 126) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/0s7dD
function name:  (null)
number of ops:  26
compiled vars:  !0 = $res, !1 = $yourArray, !2 = $elem, !3 = $subArr, !4 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $6      !1, ->21
          2    > > FE_FETCH_R                                               $6, !2, ->21
    5     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !3, $7
    6     8      > FE_RESET_RW                                      $9      !3, ->14
          9    > > FE_FETCH_RW                                              $9, !4, ->14
    7    10    >   INIT_FCALL                                               'trim'
         11        SEND_VAR                                                 !4
         12        DO_ICALL                                                 
    6    13      > JMP                                                      ->9
         14    >   FE_FREE                                                  $9
    9    15        INIT_FCALL                                               'array_merge'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !0, $11
    4    20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $6
   11    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.95 ms | 1396 KiB | 21 Q