Nov 21, 2009
Pages: 1, 2

Html Font Tags In Php - editing fonts using html?

free web hosting

Read Latest Entries..: (Post #11) by alapidus on Mar 22 2005, 12:18 AM.
Single quotes are parsed faster than double quotes because the PHP parser doesn't expect anything to be escaped or any special characters to be added in by single quotes. It just expects a plain string. Also, double quotes are used more often than single in HTML (unless you're one of those freaks that surrounds tag attributes with single quotes ), and even in normal speech. So it would make more sense to use single quotes than to escape 10 double quotes in your string, and also sacrifice...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

Html Font Tags In Php - editing fonts using html?

HmmZ
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

 

 

 


Comment/Reply (w/o sign-up)

bjrn
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.

Comment/Reply (w/o sign-up)

HmmZ
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

Comment/Reply (w/o sign-up)

bjrn
Oh, yeah, sorry. You of course have to escape the quotes:
CODE
echo "<span class=\"mystyle\">".$giorno[$gisett]." ".$mese[$mesnum]." ".date("d")."</span>";

Comment/Reply (w/o sign-up)

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

thanks for helping me bjrn smile.gif

Comment/Reply (w/o sign-up)

bjrn
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

Comment/Reply (w/o sign-up)

HmmZ
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

Comment/Reply (w/o sign-up)

bjrn
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.

Comment/Reply (w/o sign-up)

OwrLam
This truth simply

CODE

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


=)

bjrn - he is a rights

Comment/Reply (w/o sign-up)

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

Why not just use single quotes? They parse faster, are easier and faster to type, and allow you to type double-quotes without escaping them.

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

Comment/Reply (w/o sign-up)

Latest Entries

alapidus
Single quotes are parsed faster than double quotes because the PHP parser doesn't expect anything to be escaped or any special characters to be added in by single quotes. It just expects a plain string. Also, double quotes are used more often than single in HTML (unless you're one of those freaks that surrounds tag attributes with single quotes tongue.gif), and even in normal speech. So it would make more sense to use single quotes than to escape 10 double quotes in your string, and also sacrifice speed.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : html, font, tags, php, editing, fonts, html

  1. Php And Meta [resolved]
    How can I find the meta tags in php.index (3)
  2. Weird Formatting: Embedding Php Into Html
    (10)
    I have a funny problem when I embed PHP in a HTML page whenever I write some PHP code with the
    'print' or 'echo' command, the output shows the end bits of the PHP code, eg. when I
    write: CODE print "This is PHP"; ?> the output I get is: This is PHP";?> So, the final
    quote mark, the semicolon and the ending PHP tags are displayed. Has anyone else come across this
    problem before, and does anyone know a solution for it? By the way, the full code would be: CODE
    Some HTML print "This is PHP"; ?> The funny thing is, this does not ....
  3. Html Form!
    Using MySQL?! (4)
    Hey, I need your help again! I need some good working tutorial how I can update my SQL through HTML
    form. I did use some tutorials online found with the help of google; but they do not work properly;
    I mean there are still small mistakes. I need to have a good tutorial to follow. It should be
    based on security and more things. It has to be done in proper way.......
  4. How Do I Get The Result To "stick" And Add Html Tags?
    Help please? (14)
    $changepage = $_REQUEST ; echo " $changepage "; ?> Okay, I need a way for any
    information typed in my textarea to "stick" on the page in which it "posts". Since I am creating a
    way for my registered users to decorate their "homepages". So any help, tutorials, etc. would be
    greatly appreciated. ^^ Thanks.....
  5. File Checker-how To Check File Whith Html Through Html?
    (2)
    edit:sorry for the mistake it is php not html and its with not whith my code checking script= CODE
    $file = '$CHECK'; if (file_exists($file)) {     echo "The file $filename exists"; } else
    {     echo "The file $filename does not exist"; } ?> my question is how to check the file whith
    html example:on a page a text box is provided and a button the user writes a file name (or website)
    the user clicks on the submit button then it checks and show it (with the code above) i got the
    code CODE $filename=$_POST ; if (file_exists($filename)) {     echo "The....
  6. Html Code Tester. Online Script
    (15)
    Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
    this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
    Current script: CODE //Save this as something like htmltest.php function CheckForm() {
    $html_unsafe=$_POST ; //Gives us our user input $html_safe=str_replace(" //Starts security measures
    $html_safe=str_replace("?>"," ",$html_safe); //User input now secure server side //Still security
    issues client side echo $html_safe; //echos our statement } //End function //Main script....
  7. Html Site With Login
    Is it possible? (2)
    Hello. I´m building my own site and I need some help... Is it possible to use a login sistem in php
    and mysql database in a html site? ....
  8. Script To Translate Into Bbcode From Html Tags
    (1)
    I was wanting to know how to make a form like they use here for the website form. I want to be able
    to turn stuff in to bbcode. If you know how or would be willing to write the script for me could
    you email me. will@darkzone3.com . I am william to give all credit to who ever makes it. and i can
    put a link back to a site if you want. Please be specific with the topic title. "Help" is never a
    good topic title. This is explained in our forum rules. Title modified. ....
  9. Php And Flash Image Gallery
    Need some help in creating or editing an xml file while viewing some o (5)
    Hello there and thanks for the helping hand you are offering. PHP newbie here! /ph34r.gif"
    style="vertical-align:middle" emoid=":ph34r:" border="0" alt="ph34r.gif" /> So here is my problem:
    On my website I have a flash image gallery.The way the gallery works is by uploading pictures in a
    folder and editing? an xml file.(pics.xml) where it adds the following code when you upload a
    picture: CODE           etc... Now I have users that upload products they sell on the
    website or they advertise their business(hotels, jewellers, car resellers,...) So for eve....
  10. <?php ?> Marking Up With Php
    How to simply add HTML tags with PHP (0)
    Just a simple function to mark your queries /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" /> CODE $uzorak = 'Hosting credit'; //use post to get
    $uzorak variable $tapeti = "Hosting credits are collected by posting at the forums. The hosting
    credits are given after your posts are filtered and depending on its size, you get proportional
    hosting credits. Once you get the required credits you can post an application for hosting. One of
    our admins will then approve your application after which you can register an account at ht....
  11. Editing Drop Down Menu In Php
    (3)
    suppose i make a dropdown menu having value 1, 2, 3, 4, 5, one option can be selected, and selected
    option is stored in database. now i create an edit page, how do i display the selected value in the
    menu and other values in dropdown, for example, Menu is like Select One 1 2 3 4 5 and i select 3,
    this 3 is stored in database, now on the edit page i want to show 3 as already selected, something
    like that.. QUOTE 1 2 3 4 5 I will be very thankful, if
    someone could help by explaining how do i make option 3 as selected.. eg. how i....
  12. Font Effects In Nuke
    php nuke8 (0)
    hi,..i want to ask ,about how to chane the font effect0color size.. etc) in nuke php 8..i dunno
    what's wrong with it..i displayed the html scripter in copnfig file..but it seems still acceting
    the problem.. anyone can help i will be really appreciate it......
  13. Help With Moving Html Form Results To Shopping Cart?
    (3)
    Hello All- So I think I'm tackling a pretty big project here and was looking for some help... I
    am fairly new to extensive coding (beyond HTML and a little bit of JavaScript) and wanted to know
    how I can recall HTML form results on the next page (in a shopping cart) with a price based on the
    choices picked in the form. It sounds complicated...look at this example: Check out this page:
    http://www.plugcomputers.com/intelprobuild.php See how when the user goes through and picks all
    their computer parts a price at the bottom shows the system price based on their sel....
  14. Editing Information In A Mysql Database And Deleting Rows
    (5)
    I need help with a couple of things. First, I need to know how to retrieve information from a mysql
    database and edit it then re add it to the database. I also would like to know how to easily delete
    a mysql row. And I want this done without going to phpMyAdmin. Thanks for the help!....
  15. A Script To Close All Bbcode Tags In Php
    can you help me write one? (1)
    ok, ive got a chat that I made from scratch in flash. Its actually pretty damn cool! I just coded
    it so bbcode is allowed, but ive got a sligt problem. if sobody dosnt close a tag, then the tag
    stays active for the following messges. /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" /> , so i thout, why not add the end of every tag, at the end of every
    message example: CODE but then i relized, flash's html encoding is very propor,
    and all tags must be closed in the order that they were opened! CODE text text ....
  16. [help]: Php To Html (static) Converter
    I need help to use PHP to HTML Conversion (3)
    Hello Guys, I want to use PHP 2 HTML Conversion for my PHP-Nuke CMS And my PHPbb or IPB Forum, but
    don't know or does't have any idea about it. If any know about it than please tell me. In
    Trap17.com forum PHP to HTML (Static) conversion example is their, you can see it on your Address
    bar, Same thing i want to use with my PHP Codes........ Thanks in advance, i am waiting for your
    suggestion....
  17. Logging Dowload Files From Your Server Onto A Html File
    (1)
    Well, i had the idea of logging the downloads from my web in a html file few weeks ago, and i solved
    it with a lil php page included in my homepage. You could name the links with a name like
    "download.php?file=filename.ext" and then, in the download.php put the next code: (well you put
    the html and head and body tags if u want, i only write the php here) CODE if (isset($_GET ))
    $file=$_GET ; //so it gets the GET data from url (file=filename.ext); $ip=$_SERVER ;
    $file=fopen('download_log.html','a'); $date=date('d-m-y H:i:s'); $text="
    ".$....
  18. Php And Disabling Html Tags
    how can i do this? (11)
    Hello everyone Im TRYING to make a forum and obviously for security i need to disable HTML tags
    being used in posts. i know how to use the str_replace() function but to be honest i think id have
    to do that for every single tag. I also trued using the html CODE stuff tag but i need to
    be able to use the new line tag to make a new line as all the posts are stored as HTML. if this isnt
    clear let me give an example: QUOTE NEW POST PAGE > user makes new post and posts it > PHP
    PROCCESSOR PAGE MAKES HTML FILE > NEW HTML FILE CONTAINING THE POST > user veiws ....
  19. Parsing Html As Php
    and XAMPP as the server version on Windows (7)
    On my Trap17 account here, I have an .htaccess file with the following declaration which (I think)
    forces all html files to be parsed by the PHP Parsing engine and therefore I can insert snippets of
    php scripts into html files. CODE AddType application/x-httpd-php .html .htm However, when I
    add an .htaccess file to the local directory of the version of XAMPP on my local machine, it fails.
    I have tried to add the .htaccess file to the htdocs folder and elsewhere, but it still doesn't
    work to parse html through the php parser. Any ideas on how to get these htm....
  20. Adapting Html Code Embed To Work On Phpnuke
    Help With This Html Code Pls (7)
    QUOTE how can get this html code to work on my phpnuke site? what tags would i
    have to enable in the $Allowable HTML part of my config.php file?? Edited topic title. Moved to
    Programming. ....
  21. Finding Data In Meta Tags
    using php to search Meta Tags for data (0)
    In the Head portion of an Html file, there are usually several Meta Tags that contain data about
    various things, like the tag for keywords, an Author's name or maybe a description field. Here
    are two example Meta tags: HTML meta name =" Keywords " content=" keyword1, keyword2 " />
    meta name =" Description " content=" A Description of the file's content is here " /> So,
    what I have a question about concerns checking a file to see what information is included in these
    tags and using that information as variables or content in the output of the page....
  22. I Need A Php Editor
    I need that for image editing (1)
    I need a php editor whichc can be used for the image editing like FrontPage for HTML. Can any body
    give a link for that....
  23. Php And Asp.net Form
    server control html component (6)
    does this sort of feature can be done in php. http://www.w3schools.com/aspnet/aspnet_forms.asp or
    how and what are the differences.. thanks /huh.gif' border='0' style='vertical-align:middle'
    alt='huh.gif' /> ....
  24. Html Within Php Coding
    Is there a way to read HTML Code? (11)
    Is there a way to have PHP read a text file, which contains HTML Code, not text to display. This
    way i have a simple code in every page, linking to this text file, and then if i'm wanting to
    change the code, i only need to change the code in the text file. If that all makes sense?
    /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> I get the feeling it
    can be done, but the only code i have seen is one that displays the contents of the text files.....
  25. Editing Footer.php
    adding a script (2)
    hey can somebody put this script into my footer.php file? because i don't know how. the script
    has to go between the and ok this is the script... CODE clicksor_layer_border_color =
    '#B4D0DC'; clicksor_layer_ad_bg = '#ECF8FF'; clicksor_layer_ad_link_color =
    '#0000CC'; clicksor_layer_ad_text_color = '#000000'; clicksor_text_link_bg =
    ''; clicksor_text_link_color = '#000FFF'; clicksor_enable_pop = false; //-->
    and here is the fotter.php .... CODE /**********************************************....
  26. Parsing .html Pages
    (9)
    This isn't really that urgent but I was wondering, I read somewhere that you can configure you
    server to pars all html pages for php code, and I was wondering if that was true, and if trap17 has
    that feature enabled?....
  27. Best Php/html
    (2)
    I'm wondering what open source converters are out there already. I'm generating legal
    documents that require names addresses etc. I want the ability for the end user to modify the base
    document whenever they require. I plan to use the TinyMCE WYSIWYG editor to let the users edit each
    page. I will populate names and addresses dynamically based on tags in the text. Is there something
    good out there that will convert the html to pdf reliably? ....
  28. Using The Image Editing Functions Of Php
    Specifically, lines or regular polygons. (4)
    I've been experimenting a little with PHP's image functions and I was trying to see if I
    could make something that looked 3D, so I started with a cube because it's simple. To make an
    isometric picture of a cube, you need to start with a regular hexagon. However, making a regular
    hexagon isn't the easiest thing. Is there a function to create a regular polygon, or specify an
    angle and magnitude for a vector?....
  29. Executing Scripts Without Include() Function
    php function to execute a script w/o showing html markup (3)
    Hi guys. I have another newbish PHP question. /laugh.gif' border='0' style='vertical-align:middle'
    alt='laugh.gif' /> Today, I decided to make a new navigation bar for my site. It doesn't look
    good because I just started learning Flash today, so I was basically feeling my way around the
    application. Anyways, if you use Flash and you try to validate your site at http://w3.validator.org
    , you get a lot of errors for some weird reason. So I was thinking about separating the markup for
    embed Flash from the rest of the site's source code. The problem with that i....
  30. Invision Power Board help
    Editing Redirections.. (5)
    I put the login for the forums on the index of my site. (mysite.com/index.php) I want to be able to
    log on there, then have it go to another page of my site (mysite.com/members/index.php), and link
    the forums from that page, rather than it redirecting me straight to the forums. Anyone have an idea
    on how to accompolish this?....

    1. Looking for html, font, tags, php, editing, fonts, html
Similar
Php And Meta [resolved] - How can I find the meta tags in php.index
Weird Formatting: Embedding Php Into Html
Html Form! - Using MySQL?!
How Do I Get The Result To "stick" And Add Html Tags? - Help please?
File Checker-how To Check File Whith Html Through Html?
Html Code Tester. Online Script
Html Site With Login - Is it possible?
Script To Translate Into Bbcode From Html Tags
Php And Flash Image Gallery - Need some help in creating or editing an xml file while viewing some o
<?php ?> Marking Up With Php - How to simply add HTML tags with PHP
Editing Drop Down Menu In Php
Font Effects In Nuke - php nuke8
Help With Moving Html Form Results To Shopping Cart?
Editing Information In A Mysql Database And Deleting Rows
A Script To Close All Bbcode Tags In Php - can you help me write one?
[help]: Php To Html (static) Converter - I need help to use PHP to HTML Conversion
Logging Dowload Files From Your Server Onto A Html File
Php And Disabling Html Tags - how can i do this?
Parsing Html As Php - and XAMPP as the server version on Windows
Adapting Html Code Embed To Work On Phpnuke - Help With This Html Code Pls
Finding Data In Meta Tags - using php to search Meta Tags for data
I Need A Php Editor - I need that for image editing
Php And Asp.net Form - server control html component
Html Within Php Coding - Is there a way to read HTML Code?
Editing Footer.php - adding a script
Parsing .html Pages
Best Php/html
Using The Image Editing Functions Of Php - Specifically, lines or regular polygons.
Executing Scripts Without Include() Function - php function to execute a script w/o showing html markup
Invision Power Board help - Editing Redirections..

Searching Video's for html, font, tags, php, editing, fonts, html
See Also,
advertisement


Html Font Tags In Php - editing fonts using html?

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com