Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:42:03+00:00 2026-06-12T17:42:03+00:00

Having some trouble looping through these arrays , i have 4 properties that identical

  • 0

Having some trouble looping through these arrays , i have 4 properties that identical in each array
fstransid, prefix, nr and date, the rest “name”,”fsa_code”, “fsa_name”, “debits_acc” and “credits_acc” i’d like to extract these in the following 5 arrays 1->5

What’s the best way to approach this?

array(18) {
  [0]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "1681"
    ["fsa_name"]=>
    string(17) "asdfasdfasdf"
    ["debits_acc"]=>
    string(6) "546.94"
    ["credits_acc"]=>
    string(4) "0.00"
  }
  [1]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "2621"
    ["fsa_name"]=>
    string(8) "asafafasdfsas"
    ["debits_acc"]=>
    string(4) "0.00"
    ["credits_acc"]=>
    string(5) "60.75"
  }
  [2]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "3540"
    ["fsa_name"]=>
    string(5) "sfdsdfsfssssssssssss"
    ["debits_acc"]=>
    string(4) "0.00"
    ["credits_acc"]=>
    string(5) "60.71"
  }
  [3]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "6060"
    ["fsa_name"]=>
    string(27) "kostnader"
    ["debits_acc"]=>
    string(4) "9.00"
    ["credits_acc"]=>
    string(4) "0.00"
  }
  [4]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "6064"
    ["fsa_name"]=>
    string(12) "asdfasdfasdsdssdssds"
    ["debits_acc"]=>
    string(5) "11.06"
    ["credits_acc"]=>
    string(4) "0.00"
  }
  [5]=>
  array(9) {
    ["fstransid"]=>
    string(4) "4019"
    ["prefix"]=>
    string(3) "PSF"
    ["nr"]=>
    string(3) "854"
    ["date"]=>
    string(10) "2012-06-05"
    ["name"]=>
    string(33) "MY NAME"
    ["fsa_code"]=>
    string(4) "3002"
    ["fsa_name"]=>
    string(35) "assssdsdsdsd"
    ["debits_acc"]=>
    string(4) "0.00"
    ["credits_acc"]=>
    string(6) "445.54"
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:42:04+00:00Added an answer on June 12, 2026 at 5:42 pm

    Try this

    //$array is your array
    
    //Array with the identical values
    $identical_arr = array_slice($array[0], 0, 4);
    
    //Array of repeated values in arrays
    foreach ($array as $inner_array) {
      $differ_arr[] = array_slice($inner_array, 4);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having some trouble looping through some xml data. The xml file is structured
Hey guys I'm having trouble looping through some XML. Im trying to capture the
I am having some trouble with my program logic that loops through a collection
I'm having some trouble with looping and creating MS Excel docs, code snippet below
Having some trouble with R's garbage collection, when passing objects to C++. We have
I´m having some trouble retrieving a collection of strings in a projection: say that
Im having some trouble writing a getstring function, this is what I have so
I am looping through some elements using jQuery's .each() and I want to delete
I'm having some trouble with an xml file, I have found all sorts of
I'm having some trouble looping over a HashMap to print out it's values to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.