I use Array_diff comparison to read the TXT file title and I set the same, where the last field is always determined to be different, the surface of the last field more than a space, I added a space, also decided not the same, what method I use to see the TXT file the last field of the content is what??
Reply to discussion (solution)
Give me a hand. Txt?? Base64, and see if it's the same.
Can you paste out your code???
Need to see your code and test data
Private Function Checkfiletype ($array) {$type = ""; foreach ($this->filetypearray as $name = + $value) {$ar =array_diff ($array, $value); if (empty ($ar)) {$type = $name; }} return $type; }private $filetypearray =array (' DownloadFile ' =>array (' Order-id ', ' Order-item-id ', ' purchase- Date ', ' payments-date ', ' buyer-email ', ' buyer-name ', ' buyer-phone-number ', ' s Ku ', ' product-name ', ' quantity-purchased ', ' currency ', ' item-price ', ' Item-ta X ', ' Shipping-price ', ' shipping-tax ', ' ship-service-level ', ' recipient-name ', ' ship-address-1 ', ' Ship-address-2 ', ' ship-address-3 ', ' ship-city ', ' ship-state ', ' ship-postal-code ', ' ship-country ', ' Ship-phone-number ', ' delivery-start-date ', ' delivery-end-date ', ' Delivery-time-zone ', "Delivery-instructions")); $order[']= ' ('. Base64_encode ($more [28]) ') '; $order [']= ' (' Base64_encode ' ($this->filetypearray[' DownloadFile '][28]) '; [zgvsaxzlcnktsw5zdhj1y3rpb25zdq==] [+] = (zgvsaxzlcnktsw5zdhj1y3rpb25zia==)
Base64 results for two fields, the last part is different
What's that dq==? I do not add space code is zgvsaxzlcnktsw5zdhj1y3rpb25z
Base64 encoded by:
dq== is a carriage return 0x0d (Chr (13))
ia== is a space character 0x20 (Chr (32))
In general, the end-to-end whitespace characters are negligible, so it is advisable to trim
$ar = Array_diff (Array_map (' trim ', $array), Array_map (' trim ', $value));