Hello, Today i found one interesting code, there some contents was echoing using <<<OUT and OUT; as content holders: echo <<<OUT something here ' " / OUT; echo "<br>"; PHP: as you see highlighting fails! But the thing is what this code work fine! I never seen that way to output strings, even google showed nothing: google result I want to know will it work on all servers, and will it work witch older versions of php?
yup... this is another method for access string process. another example $user = 'foo'; $email = 'foo@foo.com'; echo <<<CONT Hello {$user}, good morning.<br /> Your email is {$email} CONT; PHP:
It's called 'heredoc' syntax. It's useful if you want to throw about strings with lots of quotes in them and so forth, but still want to be able to use a variable here and there. http://ca.php.net/types.string
Google doesn't play well with symbols at all. Probably my biggest/only complaint about their search function. I've never been a fan of Heredoc syntax. Half or more of php programmers you run into don't know about it. It doesn't validate under any IDE that I've ever used, and it makes formatting more difficult than standard echo ' '..' ';.