I've a port form with two textareas permitting a person to key in words separated by commas in every.

<form action="http://www.example.com/output.php" method="post">
<table border="0">
<h3 class="title">Prefix</h3>
<textarea cols="34" rows="8" name="cat[]"></textarea></td>
<h3 class="title">Suffix</h3>
<textarea cols="34" rows="8" name="cat[]"></textarea></td>

Enter words separated by a comma. 

<input type="submit" value="Go" /> </form>

After that it passes those to the output form which explodes what in the commas after which concatenates them together until all possible permutations from the test is produced. After that it prints the results right into a textarea. My problem would be that the output (although properly formatted and also have the linebreaks among each permutation) includes a br tag in the finish of every line. Eg.

testtest2<br />
testtest2<br />
testtest4<br />
testetest2<br />
testetest2<br />
testetest4<br />

Output form:

$cat = $_POST['cat']; //trait set for textbox inputs
foreach(array_keys($cat) as $key){
$cat[$key] = explode(",", str_replace(' ','',$cat[$key]));

function showCombinations($string, $traits, $i)
if ($i >= count($traits))
echo trim($string)."\n";  
foreach ($traits[$i] as $trait)
showCombinations("$string$trait", $traits, $i + 1);

<form name=form1 method=post action=''''>
<textarea><?php ShowCombinations('', $cat, 0); ?></textarea>
  1. After I take away the textarea tags for that output it really works fine.
  2. After I leave the textarea tags and take awayOrsubstitute echo trim($string)."n" with "r" or 'n' or "nr", the
    vanishes however i lose the linebreak
  3. Replace echo trim($string)."n" with echo nl2br($string) then same result as 2.
  4. Replace echo nl2br($string)."n" then same result as 1.

Would appreciate any help. My noob mental abilities are going to implode.

why don't you display the outcomes on the <div> possibly or perhaps a <p> ??

Use this, I already test drive it...

$newLineCode = "<br/>";
$message = $_POST['status'] ;
$modifiedTextAreaText = ereg_replace( "\n", $newLineCode, $message);
echo " <p>Result of Code Snippet:</p> " . $modifiedTextAreaText ;
<form action="" method="post">
<textarea name="status"></textarea>
<input type="submit"/>

I'll preface this by saying I personally use Blogger not Wordpress however i imagine you will find commonalities. In Blogger there's an environment to transform line breaks into <br> tags. I suppose it's convenient if you are not putting code clips and so on in (if you are blogging about felines or something like that) but less for programming. I needed to power it down and set during my paragraph tags, etc by hand.

Here's one less than ideal solution, that also mentions the problem of Wordpress placing <br> tags in forms.

I believe the <br /> tag is what you would like within this situation. Newline figures like n and r avoid anything in HTML - all whitespace, including newlines, is overlooked. The <br /> tag is basically the HTML equivalent - it means "break". I'm not sure an excessive amount of about PHP particularly, so I'm not sure why it's putting the <br /> there for you personally instantly, but that is the right HTML for which you are explaining.

Technically, you will find possible ways to format your output then using individuals tags, but that is much more of a professional subject. If you're a little a new comer to this, as if you stated, then just have it working by doing this for the time being, after which maybe sometime in the future you can study about proper semantic HTML markup, CSS styling, etc.