My code is
echo '<textarea name="" class="widefat" style="width:100%; height: 100px;" value="<?php ?>"></textarea>';
How can I use php inside the value
Looking forward
Thanks
My code is
echo '<textarea name="" class="widefat" style="width:100%; height: 100px;" value="<?php ?>"></textarea>';
How can I use php inside the value
Looking forward
Thanks
As @quentin mentioned, you're trying to echo
a php
tag, which you cannot. To use a variable inside a string, without messing with quotes, I normally use heredoc, i.e.:
<?php
$value = 100;
echo <<< EOF
<textarea name="" class="widefat" style="width:100%; height: 100px;" value="{$value}"></textarea>
EOF;