[thelist] [XML] PHP creation of XML.. not starting at top of page..?

Tris beertastic at gmail.com
Tue May 20 09:56:21 CDT 2008

Pastebin... I'm in love, what a GREAT idea!
Ahem.. anyhoo...

$showXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><info>";
	 foreach ($resultArrayWork as $key => $value) {
.. code...

is outputing to the browser:
"  <?xml... etc  "
note the 2 spaces before the <XML> tag.

It appears that this is causing the error.. how on earth do I fix
that? (I've tried 'strreplace' and it doesn't fix iut)


2008/5/20 Chrome <admin at chrome.me.uk>:
>> Tris,
>> There is an error message on the page, so we can't see what you are
>> talking
>> about.
>> Nan
> In Firefox, at least, you can still view source to view the original XML
> [SNIP]
>> ============
>> ...
>> ?>
>> <?=$showXml ?>
>> ============
>> So I can see that there's a line, but if I remove that line to give:
>> ?><?=$showXml ?>
>> there's still 3 spaces that appear tio be invalid..
>> so.. how can I put the first line of text at the very top left of my
>> code?
> [/SNIP]
> It sounds like there is whitespace somewhere else in the code... If you are
> opening and closing the PHP tags inside that code make sure that there are
> no newlines or spaces between the close and the next open
> Also make sure that your PHP code has no whitespace preceding your opening
> <?php
> Just some things to look for but you may want to either post some code or
> upload it to PasteBin[1] or similar
> Dan
> [1] http://pastebin.com/
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !

"The only people who don't make mistakes are those who don't do anything"

Give a man a fish and he'll feed himself for a day.
Give a man a religion and he'll starve to death praying for a fish.

`We are what we pretend to be, so we must be careful what we pretend to be.`
Kurt Vonnegut

`When a person can no longer laugh at himself, it is time for others
to laugh at him.`
Thomas Szasz

More information about the thelist mailing list