Answer the question
In order to leave comments, you need to log in
Why different length of string in array?
I do import/export. When importing, I want to compare the array from the file with the array from the database in order to find discrepancies and then go through only the id, the data of which diverges in some way. But when compared, it shows discrepancies due to the length of the strings, although the encoding is the same and the data is also the same.
First, I create an object from an array using fputcsv , and then I write the object to a csv file using fwrite. If you display arrays from the recorded file and from the database via var_dump, it shows the differences in the length of the string strings.
Example
Array from base
array(4) {
["description"]=>
string(897) "Текст..."
}
array(4) {
["description"]=>
string(895) "Текст..."
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question