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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:29:13+00:00 2026-05-26T14:29:13+00:00

i have a problem with array_diff. I have a textarea with legal email-adresses. I

  • 0

i have a problem with array_diff.

I have a textarea with legal email-adresses. I get these from a mysql-database. When i insert them into the textarea i also save them in an array.

When the form is submited i have a function who takes the content of the textarea and compares it with the first array. In that way i can see if the user has added another email-adress.

My problem is that the array_diff outputs the whole array, not the elements that are different.

I have tried to output the arrays before they are compared and they both have the right values. When i tried with dummy arrays with hardcoded values the output is correct.

What can cause this?

  • 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-26T14:29:14+00:00Added an answer on May 26, 2026 at 2:29 pm

    That depends on how you’re adding to the textarea, and how you’re getting them back.

    Assuming you have the email addresses in indivudual strings in the database, you might be combining them with \n in the textarea, then explodeing on \n… but if you’re running Windows then the lines are separated by \r\n, so you’d be comparing email@example.com with email@example.com\r, which is different. This would cause the entire array to be listed, without any visible cause.

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

Sidebar

Related Questions

I have problem to send array from database via email. I´m sure may people
Here's the problem. I ,for example,have a string 2500.Its converted from byte array into
I have problem with sending objects via TCPClient. At first, I serialize them into
i have problem passing data from one page to another using GET, for example
I have a problem with an array that is getting returned from a query
I have a problem parsing the array of objects from the JSON result. [
i.e Say: select * from tblname where col1 NOT IN array; have problem using
I have a xml file which contains data I want to insert into a
I have a problem initializing an array whose size is defined as extern const.
I have some problem to order an array by a field of this, here

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.