gple Posted June 29, 2007 Share Posted June 29, 2007 I have the following code: $myFile = "testFile.doc"; $fh = fopen($myFile, 'r'); $theData = fread($fh, 5); fclose($fh); echo $theData; but it outputs some weird stuff as below: ÐÏࡱá����������������>��þÿ ���������������*����������,������þÿÿÿ����)���ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿì¥Á�q` ��ð¿������������� ���bjbjqPqP������������������ �.��:�:� �������������������������������ÿÿ���������ÿÿ���������ÿÿ�����������������¤�����¤������¤��¤������¤������¤������¤������¤�������������¸������Ü������Ü������Ü������Ü�����è�����¸������÷��¶�����������������������������������������������������������v�����x������x������x������x������x������x��$�����h����Ž���œ���������������������¤���������������������������������������������������������œ��������������¤������¤����������������������������±�����R������R������R���������"���¤�������������¤�������������v��������������R�������������������������������������������������������������v��������������R��������������R������¤������¤��������������������������������������������������������������R�������������ô����� ‹ªm‰¹Ç��������Ü������"�� ���R��������������v������Ç��0���÷������R������£������,�����£������R������������������������������������������������������������������������������£��������������¤������R��$�����������������R�������������������������������������������������������������������������œ������œ��������������������������������������<����������������������������������������������������������÷������������������������������������������¸������¸������¸��$���Ü������¸������¸������¸������Ü������¸������¸������¸������¤������¤������¤������¤������¤������¤������ÿÿÿÿ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This Link to comment https://forums.phpfreaks.com/topic/57714-output-data-from-word-file-doc/ Share on other sites More sharing options...
Yesideez Posted June 29, 2007 Share Posted June 29, 2007 Has the doc file been created using Word? If it has you won't be able to just dump the file to the browser expecting the text as Word files contain loads of special codes like formatting that tell Word how to display the file. Link to comment https://forums.phpfreaks.com/topic/57714-output-data-from-word-file-doc/#findComment-285744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.