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 Quote 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. Quote 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'); ?> Quote 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. Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/96601-solved-echo/#findComment-494424 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.