|
Posted by Csaba Gabor on 12/06/07 11:21
R.A.M. wrote:
> Hello,
> I have little experience in PHP so I would like to ask a question. I use
> PHP5 in Windows XP Professional, Apache 2.0.59.
> I have created a website with index.php file. This file contains:
> <ul>
> <?php include('Menu/Association.inc'); ?>
> </ul>
> The file Menu/Association.inc starts with:
> <li><a href="Association.php">Strona Stowarzyszenia</a></li>
> (I mean before <li> there are no characters, "<" is first byte of the file).
> Unexpectedly in a browser I noticed additional space. When I view source I
> see in Notepad strange character between <ul> and <li> - Notepad shows it as
> square box so I guess that it is a control character, ASCII < "!".
> I tried to use readfile() instead of include() but with the same result.
> Both files, index.php and Menu/Association.inc, are encoded using UTF-8 (I
> have veryfied).
Are you talking, perhaps, about the newline followed by
3 spaces that you yourself have inserted by separating the <ul>
from the <?php by exactly that much?
Double check by looking at the hex values (with php, of course!)
$text = file_get_contents("pathToFileGoesHere");
$max = strlen($text); // or put in your own maximum
for ($i=0;$i<$max;++$i) {
// Now show the bytes or their ascii codes
$ord = ord($chr=$text[$i]);
if ($chr>="A" && $chr<="Z") $ord = $chr;
else if ($chr>="a" && $chr<="z") $ord = $chr;
else if ($ord==32) $ord = "space";
print "$ord "; }
Csaba Gabor from Vienna
[Back to original message]
|