goltoof Posted August 11, 2010 Share Posted August 11, 2010 My catalog uses a template file to list product details. One part of it is responsible for putting these details into nifty little tabs: <?php $template = '{magictabs style=black_rounded, tabwidth=110px}'; $template .= 'Technical Specifications'; $template .= '::'; $template .= '<table colspan="3"><tr><td>'; $template .= $details; $template .= '</td></tr></table>'; $template .= '||||'; ?> I don't want it to output $details, I want it to output a separate script instead. How do I include this separate file as a variable? I want this: <?php include('specs.php'); ?> to replace the $details variable. Link to comment https://forums.phpfreaks.com/topic/210492-include-file-as-a-variable/ Share on other sites More sharing options...
goltoof Posted August 12, 2010 Author Share Posted August 12, 2010 Anyone? Does this question not make sense? Link to comment https://forums.phpfreaks.com/topic/210492-include-file-as-a-variable/#findComment-1098579 Share on other sites More sharing options...
AtlasC1 Posted August 12, 2010 Share Posted August 12, 2010 You mean you want to take the contents of the specs.php file, and use that as a string? $details = file_get_contents("specs.php"); Like that? If not, perhaps you should rephrase the question... -jm Link to comment https://forums.phpfreaks.com/topic/210492-include-file-as-a-variable/#findComment-1098586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.