How to create a text box in PHP to output data

Try this

$var = 'your value';
echo '<input type="text" name="name1" value="'.$var.'">';

If you want textarea

echo '<textarea class="box">'.$var.'</textarea>';

But CSS is used for designing. It depends on yourself how you want to design it. An example for designing the textarea by box class

<style>
    .box{
        border: 1px solid #aaa; /*getting border*/
        border-radius: 4px; /*rounded border*/
        color: #000; /*text color*/
    }
</style>

Leave a Comment