note 104442 deleted from function.include by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Jun 2011 16:47:45 +0000 |
| Subject: | note 104442 deleted from function.include by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180554@lists.php.net to get a copy of this message | ||
Note Submitter: dan
----
@jdrjsbl:
I'm new here, too, so this may not be 100% correct...
First of all, I don't think you need additional <?php ?> tags around your include,
because it's just another built in function (like echo). Secondly, it seems that you can't
nest an include inside of an echo. I got your code to work by breaking the string in to two parts
and putting the include on its own line, between them:
<?php
$foo='<html><head><title>some
title</title></head><body><table><tr><td>some text ';
$bar=' some more text</tr></td></table></body></html>';
echo $foo;
include("test.php");
echo $bar;
?>
Maybe one of the pros around here can think of a better way to do this, though.
Hope that helps!