Micro$oft Word

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Micro$oft Word

Post by mikusan »

Hey, i hoped i would never come to this but here i am, i need to read a microsoft file. Import it into a string, hopefully. But i mainly have to be able to edit something and then diplay it, in a small window of mine.

Is this even possible?
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

In the worst case scenario, could someone tell me how can i transform line breaks to <BR>. That run the following code:

Code: Select all

$array = file($CFG['path_layout'] . 'files/menu/' . $Data[0]);
	$mkstring = implode ('', $array);
Where $Data[0] is the name of the file...

When i output the contents of $mkstring to my error log, i see that the text of the file has all the linebreaks intact, but when i output to the browser, they are not considered.

Now what is the correct way to do this? Should i keep it as an array and after each array value i place a <BR>? is there a more profesional way?

This is a solution using a text file instead of word...thanks
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You could add the line breaks in your implode() statement:

Code: Select all

$mkstring = implode('<br />', $array);
Mac
Post Reply