Re: question about INCLUDE behavior
| From: | Matthew Ballard | Date: | Tue, 26 Dec 2000 18:10:14 +0000 |
| Subject: | Re: question about INCLUDE behavior | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31860@lists.php.net to get a copy of this message | ||
The reason you get that is because include automatically outputs the data to the web browser, and it doesn't store the output in the variable, so all you need is:
...
if ($publication_type == "magazines") {
include ('included.inc');
}
...
and that will give the required effect. The include is returning 1 to say it was successful, so you were having include output the information, and then outputting the returned 1.
Matthew
At 12:59 PM 12/26/2000 -0500, you wrote:
Hello! I have this include file: include.inc --------- (line is not included) <table> <tr> ... </tr> </table> --------- (line is not included) In my code I am doing the following: ... if ($publication_type == "magazines") { $print_data = include ('included.inc'); echo $print_data; } ... and the results are the following --------- (line is not included) <table> <tr> ... </tr> </table> 1 --------- (line is not included) I have this " 1 " there that I don't know where come from... Could you please tell e what is that? BTW the work around that I found is the following (it is dirty but is working): --------- (line is not included) <table> <tr> ... </tr> </table> <!-- --------- (line is not included) and is printing the following now: --------- (line is not included) <table> <tr> ... </tr> </table> <!-- 1 --------- (line is not included) problem solved... I know that is veeery ugly, but I don't understand RegEx (by the way, where I can find info about this?) and I could not figure out a string function that will take out this last character... Heeeeelp!!! ;-) thank you!! Rom