pageinfo['page_text']; if(strpos($str_pagecontent,"####")!==false) { //replace all includes $offset = 0; $htmlsofar = ""; while(strpos($str_pagecontent,"####",$offset)!==false) { $hashstart = strpos($str_pagecontent,"####",$offset); $hashend = strpos($str_pagecontent,"####",($hashstart+4)); $this_include_name = substr($str_pagecontent,$hashstart+4,($hashend-$hashstart)-4); //output html so far $htmlsofar = substr($str_pagecontent,$offset,($hashstart-$offset)); echo $htmlsofar; //show include file include($_SERVER['DOCUMENT_ROOT']."/includes/".$this_include_name); //reset offset for next starting position $offset = $hashend + 4; } //finish off any residual html if($offset>0) { $htmlsofar = substr($str_pagecontent,$offset); echo $htmlsofar; } }else{ print $str_pagecontent; } ?>