|
|
|
|
![]() ![]() |
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? |
|
|
|
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. |
|
|
|
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 |
|
|
|
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>";
|
|
|
|
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 |
|
|
|
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 |
|
|
|
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?
|
|
|
|
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.
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. |
|
|
|
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 |