Forum Moderators: coopster
$datum=date("j.n.Y");
echo "Dnes je ".$datum.", meniny má ";
$mesiac = explode(".", $datum);
$subor = "calendar/".$mesiac[1].".txt";
$dni=file($subor);
echo $dni[$mesiac[0]-1] ; //i want to write this bold
echo "<br />";
echo "<b> zajtra slávi </b>";
echo $dni[$mesiac[0]]; //and this also
?>
can somebody help me?
Apply the style like this (assuming the bold words are inside a paragraph and the paragraph has a class name of "cal"):
<p class="cal">
.... <b> bold stuff here </b> ....
</p>
.
The CSS is very simple:
p.cal b { color: #7F7F7F };
.
The above code applies the style to somthing that is bold, but only when it is inside a paragraph and only if that paragraph has a class name of "cal".
.
You could do <b style="color: #7F7F7F"> but that would be an awful hack.
"<font color=[5]"[/5]red[5]"[/5]>"
You need to escape them or use single quotes:
echo "<font color=[5]\"[/5]red[5]\"[/5]>".$dni[$mesiac[0]-1]."</font>" ;
Or better still (as per g1smd's recommendation to use CSS):
echo '<span class="name">'.$dni[$mesiac[0]-1].'</span>';
Apply the style to that. Even if it were buried inside a list inside a table, you could still do it.
For example, you could apply the class name to the table tag and then use this:
table.cal tr td ul li b { color: #7F7F7F }
Look closely at the CSS. There is a space between the element names, not a comma. most people miss this special notation.