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

  • Home
  • SEARCH
  • 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 8065469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:40:29+00:00 2026-06-05T11:40:29+00:00

So here is my array, what I want to do is unset the [detail][$x]

  • 0

So here is my array, what I want to do is unset the [detail][$x] keys leaving just the lowest total. Can anyone assist? Thank you in advance..

There is alot of Products to loop though, what I mean is that its not just one item in the array.

[1] => Array
        (
            [name] => Product Name 1
            [detail] => Array
                (
                    [1] => Array
                        (
                            [total] => 10.14
                        )

                    [2] => Array
                        (
                            [total] => 12.18
                        )

                    [3] => Array
                        (
                            [total] => 9.90
                        )
  • 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-05T11:40:30+00:00Added an answer on June 5, 2026 at 11:40 am

    You can find out the lowest total and overwrite the whole detail. Something like that:

    $lowestValue = false;
    foreach ($array[1]['detail'] as $detail) {
        if ($lowestValue === false || $lowestValue > $detail['total']) {
            $lowestValue = $detail['total'];
        }
    }
    
    $array[1]['detail'] = array(0 => array('total' => $lowestValue));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$arr = array('superman','gossipgirl',...); $text = 'arbitary stuff here...'; What I want to do is
I have a multidimensional array, here: $noticeDate = json_encode( $noticesDates ); and I want
So i have a class name repository which is just a simple array.Here is
I have a multidimensional array and want to break it down. Here's the array.
I want to assign string to char array here is code - char *resultArray[100];
I have an array. I want to change their order. Here is an array
I have an array with keys and values which elements i want to push
if($err) $_SESSION['msg']['login-err'] = implode('<br />',$err); Three quick questions: Why use a two-dimensional array here?
$.getJSON(./data/revenue-item-data.php,{val:'val'},function(data){ $('#totalUnits').val(data[0].SUM(item_qty)); $('#totalAmounts').val(data[0].SUM(DISTINCT net_total)); }); Here is array I get for above code: [{SUM(item_qty):68,SUM(DISTINCT
Here is my array that is put together: Array ( [1] => 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.