html - Display PHP in Textarea -


i'm trying display php variable in text area outputs in between text area tags

here's code:

echo  "allergens contained "    .'<textarea rows="4"     name="allergens_contains">   <?php echo $contains; ?></textarea>'; 

in text area on webpage i'm getting is: <?php echo $contains; ?>

you should concatenate strings , variables via:

<?php echo 'this text ' . $php_variable . ' more text'; 

or

<?php echo "this text " . $php_variable . " more text"; 

or

<?php echo "this text $php_variable more text"; 

or

<?php echo "this text {$php_variable} more text"; 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -