I just moved some *working* code from a Win2k server running PHP 4.2.1 to a FreeBSD server running 4.2.3 and the following code no longer works...

$templatetext = preg_replace("/<!-- include\(\"([[:ascii:]]+?)\"\) -->/e", "g_includecallback(\"\\1\")", $templatetext);

if (!preg_match("/([[:ascii:]]+?)<!-- begin set -->([[:ascii:]]+?)<!-- end set -->([[:ascii:]]+?)$/i", $templatetext, $matches))
{
// Report the error and stop processing the page
g_Halt("Could not find set definition in set list template: $g_setlisttemplate");
}

The first line that processes includes works and after that line $templatetext contains the full template with the include statements replaced with the contents of the file. After the preg_match statement has run (and succeeded), $matches[0] should contain the same as $templatetext did after the previous line. However, this is not the case. A sizable chunk of the text at the start of the variable has been lost and I cannot figure out why. Can anyone give me any pointers?

Thanks.

--
Stuart


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to