[eluser]megabyte[/eluser]
I'm guessing this might be a load issue?
I'm not sure.
It worked when there was a single term in the glossary table, now there are 47.
I am using a tag based system where definitions are pulled out of a database table
So if there is you echo this:
Code:
$string = "the [brown] quick [fox] jumped over the fence.";
echo $string;
It searches the string for words enclosed in [] brackets and searches the glossary table.
Code:
function parse_all_tags($input)
{
$CI =& get_instance();
$regex = '#\[(.*?)]#';
// just as a test switch the brakets
if (is_array($input)) {
$term = strtolower($input[1]); // to lower case
// get the definintion using the term
$query = $CI->db->get_where('glossary', array('LOWER(term)' => $term));
if($query->num_rows() > 0)
{
$row = $query->row();
$input = '<a href="#" class="tool-tip">definition.'" rel="'.$row->term.'">'.$term.'</a>';
}
//$str = preg_replace('/\s+/', '', $str); // strip whitespace
}
return preg_replace_callback($regex, 'parse_all_tags', $input);
}
If I comment out the return there is no server error
anyone able to help me figure out why I'm getting a server error now?