n3m1s1s Posted June 30, 2008 Share Posted June 30, 2008 Hey guys, hopefully my question makes some sense: foreach ($lines as $line_num => $line) { $find = array("%page_title%", "%main%"); $replace = array($page_title, include($main)); $line = str_replace($find,$replace,$line); print $line; } the include($main) just does the include($main) every time it loops instead of replace the %main% How would I get it to replace the %main% with include($main)...if that's possible... Thanks a whole lot. Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted June 30, 2008 Share Posted June 30, 2008 you can't put include in an array like that...what is $main? Quote Link to comment Share on other sites More sharing options...
n3m1s1s Posted June 30, 2008 Author Share Posted June 30, 2008 The $main is main.html so I was going to have and index.html and a loop scan through that to find the %main% and where the %main% was it would include the main.html file Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted June 30, 2008 Share Posted June 30, 2008 no you can't use include like that, check out file_get_contents Quote Link to comment Share on other sites More sharing options...
n3m1s1s Posted June 30, 2008 Author Share Posted June 30, 2008 Ah yeah, thanks a lot...did exactly what I needed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.