Parsing a string
Posted: Fri Dec 16, 2005 3:00 pm
Hey, i need help parsing a string that i am receiving from mysql. Here is the code
This is what it should echo, parsed.
I want it to fill in the varialbe $weburl, but PHP doesn't parse it and i don't know how.
Code: Select all
$result = mysql_query("SELECT * FROM `content` WHERE name='current' LIMIT 1");
while($row = mysql_fetch_array($result)) {
echo $row['categories'];
}Code: Select all
<div id='head'> Tutorials </div>
<div id='content'>
» <a href='$weburl'>Home</a><br>
» <a href='{$weburl}categories/Adobe_Photoshop'>Adobe Photoshop</a><Br>
» <a href='{$weburl}categories/PHP_and_MySQL'>PHP and MySQL</a><Br>
» <a href='{$weburl}categories/Macromedia_Flash'>Macromedia Flash</a><Br>
» <a href='{$weburl}categories/Adobe_Photoshop'>Adobe Photoshop</a><Br>
</div> <div id='bottom'> </div>