Read a file with Phpexcel, how to tell if the contents of a field are not duplicated

Source: Internet
Author: User
Read the file with Phpexcel, how to tell if the content of a field is not duplicated? After reading, I want to display duplicate content, no duplicates are not displayed.

How can I tell if the contents of the read have been duplicated?


Reply to discussion (solution)

I think I need to save the data in an array and use various array functions.



Loop Excel data, you will need to compare the value of the repeating field, write to the temporary array, if the temporary array exists, give that row of data column, color, the landlord is the need for such a function bar.
$temparr = Array ();
foreach ($all _excel as $key = + $value) {
if (In_array ($temparr, $value [' name '])) {
Set a column color
}else{
Writes the name value to $temparr
}
}

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.