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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:09:56+00:00 2026-06-06T21:09:56+00:00

how do I compare the current array value with previous array value.. Example if

  • 0

how do I compare the current array value with previous array value.. Example if I have the following array and want to compare [BM1367 PD C 70][ST00576][‘transferfrom’] with previous array which is [BM1367 PD B 85][ST00576][‘transferfrom’] ?

    [BM1367    PD  B  85] => Array
        (
            [ST00576] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 102
                    [refno] =>  

                )

            [OT01606] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 66
                    [refno] => 102 - ST00576

                )

        )

    [BM1367    PD  C  70] => Array
        (
            [ST00576] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 102
                    [refno] =>  

                )

            [OT01606] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 66
                    [refno] => 102 - ST00576

                )

        )

    [BM1367    PD  C  85] => Array
        (
            [ST00576] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 102
                    [refno] =>  

                )

            [OT01606] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 66
                    [refno] => 102 - ST00576

                )

        )

    [BM1367    PD  D  85] => Array
        (
            [ST00576] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 102
                    [refno] =>  

                )

            [OT01606] => stdClass Object
                (
                    [transferfrom] => 102
                    [transferto] => 66
                    [BR_ID] => 66
                    [refno] => 102 - ST00576

                )

        )

)
  • 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-06T21:09:58+00:00Added an answer on June 6, 2026 at 9:09 pm

    You asked:

    how do I compare the current array value with previous array value

    I think you may want to look at the following PHP functions

    1. current() – http://www.php.net/manual/en/function.current.php
    2. prev() – http://www.php.net/manual/en/function.prev.php
    3. next() – http://php.net/manual/en/function.next.php

    For example:

    <?php
    $transport = array('foot', 'bike', 'car', 'plane');
    $mode = current($transport); // $mode = 'foot';
    $mode = next($transport);    // $mode = 'bike';
    $mode = next($transport);    // $mode = 'car';
    $mode = prev($transport);    // $mode = 'bike';
    $mode = end($transport);     // $mode = 'plane';
    ?>
    

    I was able to use those on a computation formula, work’s great! It is also useful when comparing current from previous or next array on yours.

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

Sidebar

Related Questions

How to compare the similarity between two arrays? Say I have: Base Array: [.5,0,0,0,.25,0,0,.25,0,0,0,0]
I'm using an external library which returns an object array for the old state
I have a custom class in Obj-C called RouteManager which contains an array of
I want to compare the classes of 2 JavaScript objects. The current call below
Greetings. I have an 2-D array of size [N][N] which will represent a rectangular
so i have an array of custom objects. i want to go through them
I Have a Mysql with the rows Data1,data2,data3...Data7 and i want to compare with
I need to compare a value to a set of array. However, I need
It is very easy to make eclipse compare the current local state of the
I'm currently using CoreLocation + CLLocationManager in order to compare a users current location

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.