PHP class constant string variable spanning over multiple lines

Posted by ebae on Stack Overflow See other posts from Stack Overflow or by ebae
Published on 2010-04-09T04:43:23Z Indexed on 2010/04/09 4:53 UTC
Read the original article Hit count: 447

Filed under:
|
|

I want to have a string variable for a PHP class, which would be available to all methods.

However, this variable is quite long, so I want to separate it into multiple lines.

For example,

$variable = "line 1" .
            "line 2" .
            "line 3";

But above doesn't work.

I tried EOD, but EOD is not allowed within class. And when I declare it outside the class, I can't access the variable from within the class.

What is the best way?

© Stack Overflow or respective owner

Related posts about php

Related posts about constant