Jump to content

[SOLVED] Array with PHP functions


n3m1s1s

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/112652-solved-array-with-php-functions/
Share on other sites

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.