I'm having problems reading the content from a file into a string or array. I've tried out several possible methods of "getting the content of a text file into a string".
The files I'm dealing with are essentially XML files. The text contents are multilingual (in this case unicode). The filesizes vary from a couple of k to about 600k.
The strange thing is that it is possible to echo out / print / send the contents to the output buffer directly without storing it in a string. The file then gets read, and the contents are displayed in the browser.
- However some characters that are not in the original file are added at the end.
- And when looking at the source (rght click browser window) a space seems to be added between every character:
"C l i q u e e m u m i t e m d a j a n e l a p a r a e x i b i r a e x p l i c a o c o r r e s p o n d e n t e . "
- If i check the encoding with mb_detect_encoding() I get this weird result: ÿþ
- When I want to write the contents to a file, that file does never get any bigger than 36 kb.
What is going on? Am I doing something wrong?
PHP is compiled as follows:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--enable-mbstring' '--enable-mbstr-euc-trans' '--enable-trans-sid'
HELP appreciated!!
Thanks
Any help appreciated.