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
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);


?>

Link to comment
Share on other sites

<?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

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.