Forum Moderators: coopster

Message Too Old, No Replies

Variable from <p>

         

almo136

11:43 pm on Aug 3, 2009 (gmt 0)

10+ Year Member



Beginner question. I would like to create a variable and assign the value of a paragraph to the variable.

So in the following case the variable would equal hello world:

<p id="test">hello world</p>

Thanks!

eelixduppy

12:17 am on Aug 4, 2009 (gmt 0)



From what I understand this is what you are looking for?

$text = 'This is where your text would go';

echo '<p id="test">' . $text . '</p>';

Please review Strings [us.php.net] and Variables [us.php.net] for additional information.

Good luck :)