Anybody have any clue how to get this to work? If I do a manual str_replace, it works but when I try to do it as a function, it does not. I want to do it as a function b/c I want to add link support to the function as well. Anyways, here's the code (and the query using strings DOES work):
PHP Code:$code=array("\n",
"/r",
"/n/r",
'[ i]',
'[ /i]',
'[ b]',
'[ /b]',
'[ u]',
'[ /u]',
'[ list]',
'[ *]',
'[ /*]',
'[ /list]');
$html=array("<br />",
"<br />",
"</p>\n</p>",
'<span style="font-style : italic ;">',
'</span>',
'<span style="font-weight : bold ;">',
'</span>',
'<span style="text-decoration : underline ;">',
'</span>',
'<ul>',
'<li>',
'</li>',
'</ul>');
function tohtml($message)
{
$output=str_replace($code,$html,$message);
return $output;
}
function fromhtml($message)
{
$output=str_replace($html,$code,$message);
return $output;
}
$query = "SELECT * FROM $table WHERE $field = '$page'";
$qyres = mysql_query($query);
while($row=mysql_fetch_array($qyres)) {
if(!isset($sid)) {
$pid=$row['pageID'];
$pname=$row['pagename'];
$sppage=$row['specialpage'];
$content=tohtml($row['content']);
}
yada....



):

)


Bookmarks