Jump to content

How do I merge a mulit-dimensional array?


jamesxg1

Recommended Posts

Hiya peeps,

 

I have this

 

Array ( [0] => Array ( [0] => { if value>valuetwo } [1] => { do } ) [1] => Array ( [0] => if value>valuetwo [1] => do ) )

 

But this could be different every time as I am using preg_match_all() how would I make them merge together or at least unset the values in curly brackets?

 

Many thanks,

 

James.

if this

Array ( [0] => Array ( [0] => { if value>valuetwo } [1] => { do } ) [1] => Array ( [0] => if value>valuetwo [1] => do ) )

is an array called $matches, I think what you are looking for is already in $matches[1].

 

Agreed, and when I do this.

 

foreach($match[1] as $k => $v) {
    $data[] $v;
}

 

I loose most of the information.

 

Many thanks,

 

James.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.