Hi,
I'm pulling some data from a database, which I then pre-process, looking for php tags.
I use the following code to do this search:
function pre_process_body($arg_body)
{
while(eregi('(.+)<\?php (.+) \?>(.+)', $arg_body, $arr_body))
{
$php = '$tmp = '.$arr_body[2];
if(substr($php,-1,1) != ';')
{
$php .= ';';
}
eval($php);
$arg_body = $arr_body[1].$tmp.$arr_body[3];
}
return($arg_body);
}
However, it works on my local development server fine, but does not work when uploaded to the server on the web - typical huh? :-)
My local server is running php 3.0.14 and phpinfo() says "Regular Expressions: Bundled regex library enabled", and the web server is running php 3.0.18 and the phpinfo() details say "Regular Expressions: System regex library enabled"
Does anybody know if my problem is the different regex library, and if so how I might change the reg exp to work on the system library, or if it's something else entirely?
Please help, apart from anything else I subbmitted the above code as a snippet, and if it's flaky (as appears to be the case, I need to fix it there too!)
Cheers,
Alan