/    Sign up×
Community /Pin to ProfileBookmark

This Phantom Chatacter IS Driving Me Nuts!!

Hi All
This is really strange.
I have two php progams, one is an include into another but every time I run the main php file the output adds a number “1” at the end. To demonstrate I have simplified the programs right down.

Main program file
<?php
$t1=”tx.php”;
echo include($t1);
exit;
?>

The included file
<html>
<body>
<p>Hello World</p>
</body>
</html>

The output
Hello World

1

Why does it put the “1” at the end of the output? Any clues appreciated.

MaxDax

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroJan 06.2004 — Because you don't echo an include, you mearly include it. The 1 is displayed because the include was sucessful. Try this, instead:

[code=php]<?php
include "tx.php";
exit();
?>[/code]
Copy linkTweet thisAlerts:
@MaxDaxauthorJan 06.2004 — Thanks Pyro, works fine now
Copy linkTweet thisAlerts:
@pyroJan 06.2004 — You are welcome. ?
×

Success!

Help @MaxDax spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...