|
Hey guys,
I'm completely new to php and attempting to program a simple text management system.
I have a database set up, and have stored paragraphs with variable names corresponding to the values I wish to be displayed.
For example:
$name = "Alan";
$p1 = $result['paragraph'];
assume that the variable $p1 has a sentence that i get from the database.
The sentence as it is written in the database is "My name is $name".
When i echo "$p1", I would like the the variable $name to appear in the sentence. i.e. My name is Alan
How would I go about this?
Thanks guys
|