Textarea shows extra space while retrieving from database?

html, mysql, php

Solution

You're inserting a lot of white-space with your formatting. Try the following instead:

<textarea name="text" rows="9"><?php 
    echo trim( $fetchedData['founder_msg'] ); // trim, following comments
?></textarea>

Problem

I have a simple php file that gets info from mysql database display inside textarea but when I open it from browsers it shows extra space at the beginning and end of the text inside textarea this is how it looks (database text has no extra space) this is what I did to retrieve the text ``` <textarea name="text" rows="9"> <?php echo $fetchedData['founder_msg']; ?> </textarea> ``` I used simple mysql_fetch_array to retrieve the value text are saved inside founder_msg field in mysql database of data type text.

Original source