Topic: .txt file keep formatting

Title says it really..

I want to show a txt file on an html page.. but I want the character returns to be kept. In other words not all bunched up. I am sure I am missing something stupid here but I am banging my head. sad

Can this be done? or how can this be done?

EXAMPLE: What I want....
Full Database Dump (Failover only)

This job does a full database dump to the local server (MWIACF01), prior to the overnight batch processing which takes place.

EXAMPLE: What I get....
Full Database Dump (Failover only) This job does a full database dump to the local server (MWIACF01), prior to the overnight batch processing which takes place.

Thanks people... smile

2

Re: .txt file keep formatting

<pre> (but save the text file as html)

Re: .txt file keep formatting

Paul.... your the man...

2 questions... big_smile

1... why save it as html
2... can I format this like anything else? and why does it go of the page.

I am going to have a little investigation into <pre> as well... wink

Cheers again paul... you have save me a lot of time.

Re: .txt file keep formatting

Yeah, just put <pre> and </pre> around your text file include.

Or use nl2br(file_get_contents('file.txt')).

Re: .txt file keep formatting

Is it just me... or do i have no control over this text now?

Re: .txt file keep formatting

Mmmh? When using the pre tag, all newlines and tabs stay as they would be in notepad...

Re: .txt file keep formatting

Sorted... I used nl2br function... works a treat. Cheers elbekko.