Results 1 to 3 of 3

Thread: Tags (or tags) PHP

  1. #1
    Join Date
    Aug 2008
    Posts
    30

    Tags (or tags) PHP

    When you save your text file with the extension. Php, you can have several codes in: from (X) HTML, JavaScript, CSS ... but also PHP. How PHP parser does the difference? he knows that the code is bounded by tags called tags. These tags are a bit special, they are presented in this form:

    Code:
    	
    <? php
    / / PHP code here
    / / more code required on several lines
    >
    The PHP code is located between the tags <? Php and>. Before you talk about the rest, I make the point on the other existing and syntax that you may encounter if you download some sources incorrectly coded. These tags <? And>. Do not use those tags that may not be compatible with all existing server configurations. Simply put, PHP has a setting called short_open_tags, it may take two values (On or Off). If it is On, this syntax will be accepted and understood by the code analysis, if your script can be interpreted, whereas if you use all the time <? Php and?>, Whatever the value this option, your script works perfectly.

  2. #2
    Join Date
    Aug 2008
    Posts
    30

    When using PHP?

    You'll probably want to learn PHP convert your entire site in PHP and replace the code (X) HTML as echo () burst. This is not a good solution, we must not use PHP to generate static content. If your page is not intended to change dynamically over time, leave it in HTML. You gain in performance and ease your server. You can also when you have many files in your know which ones are static and others.

  3. #3
    Join Date
    Aug 2008
    Posts
    30

    Display text

    Display text

    Basic Operation in PHP, the display text can be done in different ways. We will see the easiest and fastest (in terms of processing time server) to display text. This is the "function" echo () (it is a structure of language in reality and not a function, in fact it is not obligatory to use it with parentheses).

    Here is an example of displaying text using echo:

    Code:
    	
    <? php
    echo 'hello! " / / Displays the text "hello!"
    ?>
    It's all well and good but if you want to see an apostrophe how do we do? Well just add the \ (backslash) in front of the apostrophe to add. One small example is worth a thousand words:

    Code:
    <? php
    echo 'l \' apostrophe in the middle of \ 'a string';
    ? >
    You could also write it like this (with double quotes):

    Code:
    <? php
    echo "l' apostrophe in the middle of a string ";
    ? >
    The first example is faster to deal with PHP (on talk of timeliness in the section dealing with the optimization of PHP).

    Each instruction ends with a semicolon in PHP, do not forget it because you will make mistakes sometimes intractable if your code is long.

Similar Threads

  1. How to edit and fix MP3 tags
    By SoftWore in forum Tips & Tweaks
    Replies: 1
    Last Post: 10-09-2010, 10:04 PM
  2. What are an ID3 tags in PHP?
    By Jacques25 in forum Software Development
    Replies: 4
    Last Post: 28-02-2010, 03:36 AM
  3. What are Meta Tags
    By Mumtaz86 in forum Technology & Internet
    Replies: 5
    Last Post: 27-02-2010, 12:47 PM
  4. <br /> Tags are being ignored by IE7
    By Carey in forum Software Development
    Replies: 5
    Last Post: 30-12-2009, 10:58 PM
  5. Remove sub-tags in PHP / XML
    By kanchu in forum Software Development
    Replies: 2
    Last Post: 29-04-2009, 02:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,194,168.41826 seconds with 17 queries