Jump to content

[SOLVED] Large bodies of text and End of line strings


Mordax Praetorian

Recommended Posts

Greetings

 

I'm trying to code a set of php scripts that will take text from the staff at my website, turn them into finished webpages and put them on the site

 

Thanks to the brilliant site and forums here I am very confident this will be successful

 

There are still 2 things I need however

 

The first is a form type that can take large bodies of text seperated by newlines, and output it to php, something like this box i'm typing in now would be great

 

The second is clarification on how the new line strings (/n etc) are used

 

The pages I'm modifying were written originaly in Windows Notepad, which should mean they are using /r/n as a newline string, does this mean that when I read the contents of a file into a php string that any line breaks will appear as strings of /r/n which I can search for (to replace with <P> and <BR>)?

 

Also, does this mean that any instances of /r/n I add in to the finished and fully modified file will become line breaks in Notepad (for me to modify later) and be totaly ignored by any web browsers reading the html file?

 

Of the staff members working on my site, I am the only one with any knowledge of programming, and while I am new to php I do have a lot of experiance with other languages, so feel free to spam non-php specific technical terms at me, but keep in mind that the system I create in the end has to be usable by people with no comprehension of how programming works at all, I can't simply ask them to punctuate their writing with "<BR>" whenever they want a new line for example

 

Thankyou in advance

Link to comment
Share on other sites

The Form type to hold what you want is a simple enough HTML textarea form. You can define the screen size of it via columns/rows. I'm sure you can google HTML textarea and figure that out... = )

 

The receiving script that processes the form can convert the new lines to '<br>' automatically using the nl2br() function.

 

PhREEEk

Link to comment
Share on other sites

When I copy text from a web page and paste into Notepad, I get the line breaks just fine...

 

When typing into a textarea, the same behavior exists by where if I copy/paste to Notepad, those line breaks transfer as well.

 

So, you may be thinking too far ahead... = )  Try some experimenting with your form, and if something starts not behaving as expected, post and we'll figure it out!

 

PhREEEk

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.