shank shank - 2 months ago 6
PHP Question

echo textarea in php

Please let me know How to echo textarea, Tried several versions but dint work. The whole page is in php. I am using codeigniter framework

echo "<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'>"; <?php echo "$data['openletter']"; ?> </textarea>";

Answer

You're missing very basic PHP functionality and knowledge, so I'd advice you to read some coursework on beginner PHP. also, this should fix your problem

<textarea name='openletter'  id='openletter' style='width: 565px;' rows='8' cols='60'><?php echo $data['openletter'];?></textarea>

if you want everything inside an Echo :

echo "<textarea name='openletter'  id='openletter' style='width: 565px;' rows='8' cols='60'>". $data['openletter'] ."</textarea>";
Comments