/    Sign up×
Community /Pin to ProfileBookmark

Can’t remove white space

Hey,

I recently come across some “white space” on a page of my website and I couldn’t figure out what it was.

I used the Firebug tool on Firefox and I see this code appearing above one of my div tags:

[code=php][/code]

So I went through the .php file and I could not find this code anywhere to remove it.

I then did some research and found a few other people who had the same issue. They managed to remove the code by opening the .php file in Notepad++ and encoding the file to: “Encode in UTF-8 without BOM”.

I tried this and even tried opening the .php file in the default Notepad and making all the code “plain text”, then re-uploading the file to my server.

But no luck, I still have the “white space”.

Anyone have any ideas how I can fix this?

Thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@BelrickJun 28.2012 — Hiya, i was having a major display issue bug recently that caused me grief. It was caused by white space coming through from layout of my code (to make it easier to read)

For example
[code=php]
echo "<table>
<tr>
<td>hi</td>
</tr>
</table>";
[/code]

Caused me no end of grief

The fix was
[code=php]
echo "<table>";
echo "<tr>";
echo...
[/code]


Etc
Copy linkTweet thisAlerts:
@jimr451Jun 28.2012 — You can also just output the HTML code directly, like this:

[code=php]?>
<table><Tr><Td>Hi</td></tr></table>
<?
...continue php
?>[/code]


That harnesses more of the power of php - to segregate pieces of html from php code for cleaner and easier web pages.

-Jim
×

Success!

Help @Danaldinho 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...