Jump to content

[SOLVED] input output problem


mraiur

Recommended Posts

Hi.

  I need to input a text in a textarea that looks like that when typed:

"

Sentence that is here.

 

    Sentence that is two lines under the first and and aligned more right.

"

And when i printed it it looks like that

"

Sentence that is here. Sentence that is two lines under the first and and aligned more right.

"

I am a learning now and i don't know moderate amount of php functions so please give me an sugestions.

thx by mraiur.

Link to comment
https://forums.phpfreaks.com/topic/81592-solved-input-output-problem/
Share on other sites

Can you be a little more clear please? You want to merge the text? Or you just like nice colors in your text areas?

 

Other than that

 

<?php

$string = 'Sentence that is here. <br>

     Sentence that is two lines under the first and and aligned more right.';

$string = str_replace("<br>","",$string);


?>

<?php
$string = 'Sentence that is here. \n\n \tSentence that is two lines under the first and and aligned more right.';

echo nl2br($string);
?>

 

The \n\n will be turned to <br><br> thus giving you two lines lower, and no one has mentioned the indenting yet so the \t is equivelent to a press of the tab key, thus it indents it to the right slightly.

 

Sam

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.