• 0

PHP Issue with Preg_Replace_Callback() Error


Question

Hi Guys,

I'm wondering if you could help me. I have been asked to make amendments to a businesses site to which because it is PHP based I have had to copy the site & database over to my server so I can make the alterations without affecting her normal website.

The problem is, once I have made all the correct SQL imports, databases creations etc.. (Ive exported her SQL database and imported it into my PHPMyAdmin)

This error shows up on where the text from the SQL database should be shown:

Warning: preg_replace_callback() [function.preg-replace-callback]: Unknown modifier '|' in

The error is in a php file called markdown.php which converts text to HTML.

The code in itsself which the error is pointing to is below:

	$text = preg_replace_callback("{
			(?:\\n\\n|\\A)
			(	            # $1 = the code block -- one or more lines, starting with a space/tab
			  (?:
				(?:[ ]\{$md_tab_width} | \\t)  # Lines must start with a tab or a tab-width of spaces
				.*\\n+
			  )+
			)
			((?=^[ ]{0,$md_tab_width}\\S)|\\Z)	# Lookahead for non-space at line-start, or end of doc
		}xm",
		[b]'_DoCodeBlocks_callback', $text);[/b]

	return $text;
}
function _DoCodeBlocks_callback($matches) {
	$codeblock = $matches[1];

The bolded line is where the error is pointing to.

Any help would be greatly appreciated.

Many thanks,

Ben.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.