dare87 Posted March 17, 2008 Share Posted March 17, 2008 Is there a way to have an include inside of an echo? Example: echo '<?php include('auxiliary/left.php') ?> <a href="user_add.php">Add</a> <?php include('auxiliary/right.php') ?>'; Thanks Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/ Share on other sites More sharing options...
papaface Posted March 17, 2008 Share Posted March 17, 2008 you could try something like: echo file_get_contents('auxiliary/left.php'). '<a href="user_add.php">Add</a>'. file_get_contents('auxiliary/right.php'); I've never really tried it that way before though. Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/#findComment-494328 Share on other sites More sharing options...
soycharliente Posted March 17, 2008 Share Posted March 17, 2008 What's wrong with? <?php include('auxiliary/left.php'); echo '<a href="user_add.php">Add</a>'; include('auxiliary/right.php'); ?> Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/#findComment-494339 Share on other sites More sharing options...
papaface Posted March 17, 2008 Share Posted March 17, 2008 What's wrong with? <?php include('auxiliary/left.php'); echo '<a href="user_add.php">Add</a>'; include('auxiliary/right.php'); ?> Nothing. But I presume the OP asked it like he/she did for a reason. Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/#findComment-494341 Share on other sites More sharing options...
soycharliente Posted March 17, 2008 Share Posted March 17, 2008 If it was for trying to put things on one line, not that it's not a good reason, but it doesn't seem like a big difference. You could always do this: <?php include('auxiliary/left.php'); echo '<a href="user_add.php">Add</a>'; include('auxiliary/right.php'); ?> Thought I don't know what the original reason is/was. OP = Original Poster? Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/#findComment-494424 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.