Finding & Replacing New lines
So that you could make your own web pages at math warehouse, I needed to create the PHP code to deal with multi line textareas that include line breaks.
Useful Code Snippets-- Newlines Textarea
Replace New lines
- A core feature of free hosting was a file manager that allows users to create and edit web pages that are displayed in large text areas. However, for the program to pass all of the information in the textarea as a string. I could either A) remove all new lines or B) replace them with a special string that would be like a 'code word' for 'i'm a new line' so that later on that said code word could be again replaced with new lines (that way if someone wanted to edit the web page at a later time, the new lines would still be there. The latter solution, B, was what I chose, and here is a snippet showing how PHP can find and replace the new line.
The actual php code
//whatever you want to replace new lines with
= " **aNewLine**";
= $_POST['myTextArea'] ; //unadulterad text we got via Post
$modifiedTextAreaText = ereg_replace( "\n", $newLineCode, $message);
echo " Result of Code Snippet " . $modifiedTextAreaText ;