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 6895617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:55:54+00:00 2026-05-27T06:55:54+00:00

I have an array full of dynamic <select> field options, that I would like

  • 0

I have an array full of dynamic <select> field options, that I would like to be split into separate arrays based on a certain value within each “loop”.

Basically, I’d like two arrays: one with the data associated with [subfirmdetailtype_id] = 14, and one with [subfirmdetailtype] = 25.

Any help would be appreciated!

Array
(
    [0] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Open
                    [subfirmdetailtype_id] => 14
                )

        )

    [1] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Closed
                    [subfirmdetailtype_id] => 14
                )

        )

    [2] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Large Growth
                    [subfirmdetailtype_id] => 25
                )

        )

    [3] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Large Blend
                    [subfirmdetailtype_id] => 25
                )

        )

    [4] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Large Value
                    [subfirmdetailtype_id] => 25
                )

        )

    [5] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Mid Growth
                    [subfirmdetailtype_id] => 25
                )

        )

    [6] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Mid Blend
                    [subfirmdetailtype_id] => 25
                )

        )

    [7] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Small Growth
                    [subfirmdetailtype_id] => 25
                )

        )

    [8] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Small Blend
                    [subfirmdetailtype_id] => 25
                )

        )

    [9] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Small Value
                    [subfirmdetailtype_id] => 25
                )

        )

    [10] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => World Bond
                    [subfirmdetailtype_id] => 25
                )

        )

    [11] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Multisector Bond
                    [subfirmdetailtype_id] => 25
                )

        )

    [12] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Municipal Debt
                    [subfirmdetailtype_id] => 25
                )

        )

    [13] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Heigh Yield Muni
                    [subfirmdetailtype_id] => 25
                )

        )

    [14] => Array
        (
            [Subfirmdetailoption] => Array
                (
                    [option] => Heigh Yield
                    [subfirmdetailtype_id] => 25
                )

        )

)
  • 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-05-27T06:55:55+00:00Added an answer on May 27, 2026 at 6:55 am

    This will group arrays the way you want:

    $new_array = array();
    
    foreach ($your_array as $array) {
      $new_array['subfirmdetailtype_id'][
         $array['Subfirmdetailoption']['subfirmdetailtype_id']
      ][] = $array['Subfirmdetailoption'];
    }
    

    Later you can access groups like this:

    $new_array['subfirmdetailtype_id'][14];
    $new_array['subfirmdetailtype_id'][15];
    

    Or loop through these grouped arrays.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array that looks like this (the full list is here ):
I have an array full of patterns that I need matched. Any way to
How would you sort a multidimensional array in JavaScript? I have an array full
I have got an array full with items like these: array( array( 'id' =>
I have an array full of sub arrays. I need to break apart the
I have a vector 3 (x,y,z) 1D dynamic array full of vertex positions. How
I have a array that is full of image objects, I need to be
I have an array full of user logins that was loaded from the database.
I have an array full of post IDs like $post_id = array(3,56,89,98); Now what
Trying to split what the user writes in the text field, into an array

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.