Reply to Re: heardoc problem

Your name:

Reply:


Posted by JP on 12/06/07 15:50

I use the VIM editor on Windows (VI for Windows) so not sure that I
have any invalid characters since other scripts that I edit with same
editor work just fine.

Anyway, I tried the following:

created a new t.php file containing the following
<?php
$tst = <<<EOL
test
EOL;
echo "$test\n";
?>

One file, I created in VIM and got the same error when executing.
Then, I created a new file with Notepad with the same text above.
That one runs
with no problems. So looks like for heardocs, there is some weirdness
with using the VIM
editor perhaps!



On Dec 6, 10:39 am, Janwillem Borleffs <j...@jwscripts.com> wrote:
> JP schreef:> When I attempt to run it at the command line
> > C:\ php t.php
>
> > I get the following error:
> > PHP Parse error: syntax error, unexpected $end in C:\Sebastian\pbuuc
> > \auction\t.php on line 12
>
> >
>
> Perhaps the file contains control characters originating from your
> editor (word?). When you have access to a *nix platform, try to clean
> the file with the dos2unix utility.
>
> If you don't have access to this utility, but your editor supports
> exports to ascii text or utf-8 encoding, use that.
>
> JW

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация