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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:57:55+00:00 2026-06-01T06:57:55+00:00

An array Array ( [0] => Array ( [Detail] => Array ( [detail_id] =>

  • 0

An array

Array
(
    [0] => Array
    (
        [Detail] => Array
        (
            [detail_id] => 1
        )

    )

    [1] => Array
    (
        [Detail] => Array
        (
            [detail_id] => 4
        )

    )

)

Is it possible to use implode function with above array, because I want to implode detail_id to get 1,4.

I know it is possible by foreach and appending the array values,
but want to know whether this is done by implode function or any other inbuilt function in PHP

  • 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-01T06:57:56+00:00Added an answer on June 1, 2026 at 6:57 am

    If you need to use some logic – then array_reduce is what you need

    $result = array_reduce($arr, function($a, $b) {
        $result = $b['Detail']['detail_id'];
    
        if (!is_null($a)) {
            $result = $a . ',' . $result;
        }
    
        return $result;
    });
    

    PS: for php <= 5.3 you need to create a separate callback function for that

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

Sidebar

Related Questions

I have a master detail Application in xCode. In Master View Controller an Array
I have a UITableView which I want to populate with details from an array
Is it possible to use generic support with single table inheritance, and still be
Its probarbly a simple 3-tier problem. I just want to make sure we use
I have detail page for products and i want to add a module of
<a href=<?php $this->url(array('controller' => 'page', 'action' => 'page-detail', 'page_id' => $show_today['id']));?>><?php echo $show_today['id']; ?></a>
is it possible to pass array as parameter in smarty? here is my code.
General question: Is it possible to use a ClassLoader to replace a pre-loaded (by
I'm trying to get an array that contains information from three tables. The result
I have a struct-array that contains details of different reports that can be run.

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.