Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Html Font Tags In Php, editing fonts using html?
HmmZ
post Mar 6 2005, 03:36 PM
Post #1


Super Member
*********

Group: Members
Posts: 362
Joined: 2-March 05
From: The Netherlands
Member No.: 4,097



I have a php script thats is fully written in php (no html at all). Now for my question, how can i edit the fonts?

Ill make it easier to understand, the following is a data script (found the script):
CODE
<?
$mese[0]="-";
$mese[1]="January";
$mese[2]="February";
$mese[3]="March";
$mese[4]="April";
$mese[5]="May";
$mese[6]="June";
$mese[7]="July";
$mese[8]="August";
$mese[9]="September";
$mese[10]="Octobre";
$mese[11]="November";
$mese[12]="December";

$giorno[0]="Sunday";
$giorno[1]="Monday";
$giorno[2]="Tuesday";
$giorno[3]="Wednesday";
$giorno[4]="Thursday";
$giorno[5]="Friday";
$giorno[6]="Saturday";

$gisett=(int)date("w");
$mesnum=(int)date("m");

echo $giorno[$gisett]." ".$mese[$mesnum]." ".date("d");

?>


Id like to edit the font that will come out of the echo, right now its a normal font, while I want to keep the same font i use on my sites tables, is it possible?sad.gif
Go to the top of the page
 
+Quote Post
bjrn
post Mar 6 2005, 03:47 PM
Post #2


Super Member
*********

Group: Members
Posts: 378
Joined: 8-January 05
Member No.: 3,174



I don't really know in what context you are printing the output, but assuming it is in a html page somewhere you could do something like this:
CODE
<?echo "<span class="mystyle"".$giorno[$gisett]." ".$mese[$mesnum]." ".date("d")."</span>";?>

And replace "mystyle" with the class you use for your tables, or add a .mystyle class to your css file. Or you could replace class="mystyle" with style="font-family: sans-serif" or whatever font you are using in your tables.
Go to the top of the page
 
+Quote Post
HmmZ
post Mar 6 2005, 04:14 PM
Post #3


Super Member
*********

Group: Members
Posts: 362
Joined: 2-March 05
From: The Netherlands
Member No.: 4,097



CODE
echo "<span class="stats">".$giorno[$gisett]." ".$mese[$mesnum]." ".date("d")."</span>";


is not working sad.gif. Must be some stupid typo somewhere tongue.gif
Go to the top of the page
 
+Quote Post
bjrn
post Mar 6 2005, 04:20 PM
Post #4


Super Member
*********

Group: Members
Posts: 378
Joined: 8-January 05
Member No.: 3,174



Oh, yeah, sorry. You of course have to escape the quotes:
CODE
echo "<span class=\"mystyle\">".$giorno[$gisett]." ".$mese[$mesnum]." ".date("d")."</span>";
Go to the top of the page
 
+Quote Post
HmmZ
post Mar 6 2005, 09:00 PM
Post #5


Super Member
*********

Group: Members
Posts: 362
Joined: 2-March 05
From: The Netherlands
Member No.: 4,097



yay it worked when i used a stylesheet for everything ^^

thanks for helping me bjrn smile.gif
Go to the top of the page
 
+Quote Post
bjrn
post Mar 6 2005, 09:11 PM
Post #6


Super Member
*********

Group: Members
Posts: 378
Joined: 8-January 05
Member No.: 3,174



Glad to help. Though, I just started looking at what you're printing, and if you just want to echo "Sunday/March/06" (or whatever the current date is), you can do this:
CODE
date("l/F/d");

Full list of all things the date() functions can do: http://php.net/date
Go to the top of the page
 
+Quote Post
HmmZ
post Mar 6 2005, 11:49 PM
Post #7


Super Member
*********

Group: Members
Posts: 362
Joined: 2-March 05
From: The Netherlands
Member No.: 4,097



lol, it's pretty funy people make scripts like these then isn't it?smile.gif. Anywayz, its installed and showing correctly, not going to edit that part anymore smile.gif
Go to the top of the page
 
+Quote Post
bjrn
post Mar 9 2005, 06:45 PM
Post #8


Super Member
*********

Group: Members
Posts: 378
Joined: 8-January 05
Member No.: 3,174



It doesn't really matter that there is a built-in function for it, at least you've learned some more PHP and what you have now is working. smile.gif

But if you are going to use date things some other time I recommend the date() function, it's really nice, and you can also give a timestamp as argument, so if you have a guestbook you can store the text and date in a database and then when you show it on a page you can use the date() function to format the timestamp the way you like.
Go to the top of the page
 
+Quote Post
OwrLam
post Mar 17 2005, 05:02 PM
Post #9


Newbie [Level 3]
***

Group: Members
Posts: 46
Joined: 17-March 05
Member No.: 4,610



This truth simply

CODE

echo "<span class=\"mystyle\">".$giorno[$gisett]." ".$mese[$mesnum]." ".date("d")."</span>";


=)

bjrn - he is a rights