Jump to content

preg_replace to include external page returns at top HELP!!!


Alchemy

Recommended Posts

Working on a templating class.... and everything works fine, but when I used this part of the class

[code]
<?php
// Replace the <DYNAMIC BLOCK "page.php"> tags with the desired page
$rep = array("<?","?>","<?php","php?>");
$this->Template = preg_replace("/\<DYNAMIC BLOCK \"(.*?)\"\>/e", 'eval(str_replace($rep,\'\',file_get_contents($site[\'phys\']."blocks/\\1")))', $this->Template);
?>[/code]

If works fine, but... the page it just pulled gets positioned at the very beginning of the page instead of where it got pulled from....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.