I have my $arr of key value pairs like this:

array(7) {
  ["No"]=>
  string(6) "101"
  ["Paper_id"]=>
  string(6) "WE3P-1"
  ["Title"]=>
  string(80) ""An Electrically-Small, 3-D Cube Antenna Fabricated with Additive Manufacturing""
  ["Author"]=>
  string(13) "NassarIbrahim"
  ["Auth_order"]=>
  string(9) "WE3P-1-01"
  ["Aff_list"]=>
  string(51) ""University of South Florida, Tampa, United States""
  ["Abstracts"]=>
  string(723) ""This paper presents the design of an electrically small""
}

array(4) {
  ["Author"]=>
  string(12) "WellerThomas"
  ["Auth_order"]=>
  string(9) "WE3P-1-02"
  ["Aff_list"]=>
  string(51) ""University of States""
  ["Abstracts"]=>
  string(2) "
"
}

array(7) {
  ["No"]=>
  string(3) "104"
  ["Paper_id"]=>
  string(6) "TU5A-3"
  ["Title"]=>
  string(40) "Signal-Interference Microstrip Duplexers"
  ["Author"]=>
  string(19) "Gomez-GarciaRoberto"
  ["Auth_order"]=>
  string(9) "TU5A-3-01"
  ["Aff_list"]=>
  string(48) ""University of  Spain""
  ["Abstracts"]=>
  string(535) ""Microwave planar duplexers shaped by signal-interference bandpass filters in their branches are presented."
"
}

array(4) {
  ["Author"]=>
  string(20) "Sanchez-RenedoManuel"
  ["Auth_order"]=>
  string(9) "TU5A-3-02"
  ["Aff_list"]=>
  string(48) ""University of Spain""
  ["Abstracts"]=>
  string(2) "
"
}

I want to join these arrays such that if their 'Auth_order' are sub-strings( like WE3P-1-101 and WE3P-1-02 ) then Author is concatenated to previous array and current array is unset.Eg:( If array that has WE3P-1-02 as Author_order then this array's 'Author' is concatenated with WE3P-1-01 'Author' and that array containing WE3P-1-02 is unset. Please help me out here guys?

I have tried some things using current($arr),prev($arr) ..but its not working!!

Member Avatar for diafol

Could you give a mockup of the output that you would get from your example?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.