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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:16:11+00:00 2026-06-15T22:16:11+00:00

Possible Duplicate: recursive array_diff()? Array 1 => pr($plan_data); Array ( [0] => Array (

  • 0

Possible Duplicate:
recursive array_diff()?

Array 1 =>

    pr($plan_data);
    Array
    (
        [0] => Array
            (
                [AveragePrice] => 9.631161
                [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161456
                [EarlyTerminationFee] => 150
                [HurricaneRecovery] => 0.132
                [MeterSurcharge] => 3.05
                [OffCycle] => 5
                [PUCAssessment] => 0.00167
                [PlanDescription] => Savings Champ-6
                [PlanId] => 57
                [PlanIssueDate] => 12/10/2012
                [PlanMonthlyFee] => 0
                [PlanName] => PN1058
                [PlanRate] => 9.3
                [PlanRenewablePercent] => 7.2
                [PlanTerm] => 6
                [PriorityMoveIn] => 36
                [ProviderDisplayName] => CenterPoint Energy
                [ProviderId] => 21
                [ProviderInternalName] => CNP_COAST
                [RateId] => 161456
                [RegularMoveIn] => 16
                [TDSPPassThrough] => 0.03791
                [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161456
                [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
                [provider] => ces
                [ProductType] => Fixed
                [Rep] => Champion Energy Services
                [Zone] => 77479
            )

        [1] => Array
            (
                [AveragePrice] => 10.1311693
                [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161458
                [EarlyTerminationFee] => 150
                [HurricaneRecovery] => 0.132
                [MeterSurcharge] => 3.05
                [OffCycle] => 5
                [PUCAssessment] => 0.00167
                [PlanDescription] => Savings Champ-12
                [PlanId] => 59
                [PlanIssueDate] => 12/10/2012
                [PlanMonthlyFee] => 0
                [PlanName] => PN1060
                [PlanRate] => 9.8
                [PlanRenewablePercent] => 7.2
                [PlanTerm] => 12
                [PriorityMoveIn] => 36
                [ProviderDisplayName] => CenterPoint Energy
                [ProviderId] => 21
                [ProviderInternalName] => CNP_COAST
                [RateId] => 161458
                [RegularMoveIn] => 16
                [TDSPPassThrough] => 0.03791
                [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161458
                [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
                [provider] => ces
                [ProductType] => Fixed
                [Rep] => Champion Energy Services
                [Zone] => 77479
            )

        [2] => Array
            (
                [AveragePrice] => 10.4311743
                [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161459
                [EarlyTerminationFee] => 150
                [HurricaneRecovery] => 0.132
                [MeterSurcharge] => 3.05
                [OffCycle] => 5
                [PUCAssessment] => 0.00167
                [PlanDescription] => Green Power-12
                [PlanId] => 60
                [PlanIssueDate] => 12/10/2012
                [PlanMonthlyFee] => 0
                [PlanName] => PN1061
                [PlanRate] => 10.1
                [PlanRenewablePercent] => 100
                [PlanTerm] => 12
                [PriorityMoveIn] => 36
                [ProviderDisplayName] => CenterPoint Energy
                [ProviderId] => 21
                [ProviderInternalName] => CNP_COAST
                [RateId] => 161459
                [RegularMoveIn] => 16
                [TDSPPassThrough] => 0.03791
                [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161459
                [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
                [provider] => ces
                [ProductType] => Fixed
                [Rep] => Champion Energy Services
                [Zone] => 77479
            )
)

Array 2 =>

pr($temp_val);
Array
(
    [0] => Array
        (
            [id] => 6
            [PlanId] => 60
            [PlanName] => Bounce 12 + A/C Protection
            [PlanDescription] => Bounce 12 + A/C Protection - CNP
            [PlanTerm] => 12
            [PlanRate] => 
            [RateId] => 
            [PlanIssueDate] => 
            [PlanMonthlyFee] => 
            [EarlyTerminationFee] => 200.00000
            [AveragePrice] => 12.00000
            [HurricaneRecovery] => 
            [PlanRenewablePercent] => 
            [ProviderDisplayName] => 
            [ProviderId] => 1
            [provider] => bounce
            [ProductZoneId] => 353
            [Zone] => 77479
            [ProviderInternalName] => 
            [RegularMoveIn] => 
            [PriorityMoveIn] => 
            [OffCycle] => 
            [TDSPPassThrough] => 
            [PUCAssessment] => 
            [EFLUrl] => 
            [EFLLinkUrl] => http://www.bounceenergy.com/efls/bounce12.pdf
            [TOCUrl] => 
            [TOCLUrl] => http://www.bounceenergy.com/terms-of-service-fixed.pdf
            [YRACUrl] => 
            [YRACLUrl] => http://www.bounceenergy.com/yraac.pdf
            [REP_Name] => 
            [REP_PUCT] => 
            [customer_service_email] => 
            [toll_free_number] => 
            [status] => active
            [created] => 2012-12-14 12:40:05
            [modified] => 2012-12-14
        )

    [1] => Array
        (
            [id] => 18
            [PlanId] => 17
            [PlanName] => Online Only - 12
            [PlanDescription] => Online Only - 12
            [PlanTerm] => 12
            [PlanRate] => 
            [RateId] => 386
            [PlanIssueDate] => 
            [PlanMonthlyFee] => 100.00000
            [EarlyTerminationFee] => 175.00000
            [AveragePrice] => 10.00000
            [HurricaneRecovery] => 
            [PlanRenewablePercent] => 
            [ProviderDisplayName] => 
            [ProviderId] => 2
            [provider] => fulcrum
            [ProductZoneId] => 
            [Zone] => 77479
            [ProviderInternalName] => 
            [RegularMoveIn] => 
            [PriorityMoveIn] => 
            [OffCycle] => 
            [TDSPPassThrough] => 
            [PUCAssessment] => 
            [EFLUrl] => 
            [EFLLinkUrl] => 
            [TOCUrl] => 
            [TOCLUrl] => 
            [YRACUrl] => 
            [YRACLUrl] => 
            [REP_Name] => 
            [REP_PUCT] => 
            [customer_service_email] => 
            [toll_free_number] => 
            [status] => active
            [created] => 2012-12-14 12:40:15
            [modified] => 2012-12-14
        )
)

I want to compare this two array and if any key value is different i want to take it an different array..

$result_val= array_diff_assoc($plan_data, $temp_val);

Please help me out !!

  • 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-15T22:16:12+00:00Added an answer on June 15, 2026 at 10:16 pm

    Try something like this:

    function array_diff_assoc($a, $b) {
        $result = array();
        foreach ($a as $k => $v) {
            if ($b[$k] != $v) {
                $result[$k] = [$v, $b[$k]];
            }
        }
        return $result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: recursive array_diff()? I have a static multidimensional array which is always going
Possible Duplicate: linq to sql recursive query I got stuck with having to build
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How to find the kth largest element in an unsorted array of
Possible Duplicate: What is a RECURSIVE Function in PHP? What is a recursive function
Possible Duplicate: Solution to a recursive problem (code kata) give an algorithm to find
Possible Duplicate: How write a recursive print program I have already asked this question,
Possible Duplicate: Simplest way to do a recursive self-join in SQL Server? I have
Possible Duplicate: PHP convert nested array to single array while concatenating keys? Get array's

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.