Home > Archive > PHP Language > March 2006 > print <<<
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Jean Pierre Daviau 2006-03-10, 6:56 pm |
| Hi to every one,
I have a problem printing this on console. The command line declare that
ther is an unexpected $end; at line 77. Line 77 being the last ?>
If I take that of everything is fine.
print <<<eotext
<style type="text/css">
body {
font-size: 10px;
line-height:18px;
}
.title {
font-variant: small-caps;
margin-bottom: -8px;
}
</style>
eotext;
======== if you need the context ===========
.............................
print <<<eotext
<style type="text/css">
body {
font-size: 10px;
line-height:18px;
}
.title {
font-variant: small-caps;
margin-bottom: -8px;
}
</style>
eotext;
$p = 0;
$strback = '';
while(!feof($myFile))
{
//read a line from the file
$myLine = fgets($myFile, 255);
if(strlen($myLine) > 2){
if ($p === 0){
$strback = '<p>'.$myLine.'</br>';
$p = 1;
}else{
if($strback === ''){
$strback = $myLine.'</br>';
}else{
$strback = $strback.$myLine.'</br>';
}
}
}else{
$p = 0;
if(strlen($strback) > $baselength){
$strback = str_replace("<p>", "<p style='margin-bottom: 40px;'>",
$strback);
print strip_tags($strback, '<p>')."</p>\n";
}else{
$strback = str_replace("<p>", "<p class=title>", $strback);
print strip_tags($strback, "<p>")."</p>\n";
}
$strback = '';
}
}
//close the file
fclose($myFile);
print "\n\n".'N.B.: leave an empty line at the end of file.';
}
--
Thanks for your attention.
Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com
| |
|
| "Jean Pierre Daviau" <Once@WasEno.ugh> wrote in message
news:k1oQf.55036$Zv1.228984@weber.videotron.net...
> Hi to every one,
>
> I have a problem printing this on console. The command line declare that
> ther is an unexpected $end; at line 77. Line 77 being the last ?>
>
> If I take that of everything is fine.
> print <<<eotext
> <style type="text/css">
> body {
> font-size: 10px;
> line-height:18px;
> }
> .title {
> font-variant: small-caps;
> margin-bottom: -8px;
> }
> </style>
> eotext;
EOTEXT needs to be uppercase;
print <<<EOTEXT
<style type="text/css">
body {
font-size: 10px;
line-height:18px;
}
.title {
font-variant: small-caps;
margin-bottom: -8px;
}
</style>
EOTEXT;
Cheers,
Rich
| |
| Jean Pierre Daviau 2006-03-11, 7:55 am |
| Does not work either.
"Rich" <rflack@gmail.com> a écrit dans le message de news:
uhrQf.34001$wl.18732@text.news.blueyonder.co.uk...
> "Jean Pierre Daviau" <Once@WasEno.ugh> wrote in message
> news:k1oQf.55036$Zv1.228984@weber.videotron.net...
>
> EOTEXT needs to be uppercase;
>
> print <<<EOTEXT
> <style type="text/css">
> body {
> font-size: 10px;
> line-height:18px;
> }
> .title {
> font-variant: small-caps;
> margin-bottom: -8px;
> }
> </style>
> EOTEXT;
>
> Cheers,
> Rich
>
| |
| Jean Pierre Daviau 2006-03-11, 7:55 am |
| [color=darkred]
print <<<EOTEXT[color=darkred]
EOTEXT;
Sorry, you are right the problem was print <<<EOTEXT was indented like
this:
print <<<EOTEXT
|
|
|
|
|