Q:

calling include function in echo statement

I am using whole code in php so i am using echo statement for displaying divs in html but how could i call php include function in echo statement to call a page see the code below:-
 echo "<div style='position:relative;border:1px solid #A5BEBE;background-color: white;'>
 include('botfunction.php');
 </div>";

it is not  calling that botfunction.php it just shows the text only as "include('botfunction.php');" inside the div tag .

Please tell me how can i call this php function without separating php and html code  because the whole code is written in php which is impossible to separate.

Thanks

A:

This is going to be an absolute nightmare to maintain and if it is impossible to separate then I suggest rewriting from scratch. But as for your question, try this:
echo "<div style='position:relative;border:1px solid #A5BEBE;background-color: white;'>";
include('botfunction.php');
echo "</div>";

You just need to move the include out of the echo string otherwise it will be evaluated as a string instead of a function

