Real quick here is what I am trying to do. I'm creating a journal application that will automatically create links based on certain keywords in the entry. It pulls the entry from the database, parses it looking for keywords from an array and then does a simple string replace. Funny thing is, it works. Even though I get the error message, it still does it's job. Working exactly as I expected it to with the exception of the annoying error message at the top of the page.Warning: Missing argument 1 for keyword() in C:\Long\MS\Path\To\File\classes\keyword.class.php on line 14
OK how about some code.
First step I drop the results of a SELECT statement into a variable
Code: Select all
<?php
$text = $bbcode -> parse_bbcode($v -> sqlOut($row['journal_text']));
?>Code: Select all
<?php
echo $keywords -> keyword($text);
?>Code: Select all
<?php
function keyword($value) //this is line 14 of the file keyword.class.php
{
$keyword = array(
"Windows 2000" => "http://www.microsoft.com/windows2000/",
"Microsoft" => "http://www.microsoft.com/"
);
foreach ($keyword as $k => $v) {
$value = str_replace($k, "<a href="$v" target="_blank">$k</a>", $value);
}
return $value ;
}
?>Any ideas?