Welcome Guest, Not a member yet? Register   Sign In
Output has an empty line
#1

[eluser]stanleyxu[/eluser]
Hello,

I define a function in my own controller. The output contains an empty line at the beginning.

For instance:
Code:
class Myclass extends Controller {
  function test() {
    echo 'Hello';
  }
}

The output will be
Code:
'

Hello'


This empty line at beginning should not appear. My function tries to generate an image. But now the output contains an empty line at the beginning. The image is no longer recongizable.


Any comments ?
#2

[eluser]stanleyxu[/eluser]
The problem has been solved. There are two empty lines at the end of my unit. So ...
#3

[eluser]champs[/eluser]
This is one very important reason why Zend discourages use of the closing PHP tag.
#4

[eluser]stanleyxu[/eluser]
[quote author="champs" date="1207457474"]This is one very important reason why Zend discourages use of the closing PHP tag.[/quote]
Thanks for the note. I really did not know, I can save the closing tag ("?>") at all. Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB