Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using php include with in a echo

Tags:

php

I need to echo an php include. I have tried the below but neither work?

echo "<td>include'file.php'</td>";
echo "<td><?php include/file.php'?></td>";

Why doesn't this work and how can this be achieved?

like image 690
Rick Skeels Avatar asked Aug 23 '26 09:08

Rick Skeels


1 Answers

You cannot start a new php block inside a php block.

You would probably do something like this:

echo "<td>";
include 'file.php';
echo "</td>";
like image 177
Repox Avatar answered Aug 25 '26 23:08

Repox