PHP Lessons # 1 | What is PHP Key and its Usage

Discussion in 'Web Programming' started by hbkyatty, Apr 10, 2018.

  1. hbkyatty

    hbkyatty New Member

    Hello Friends,
    Today I will start to give PHP tutorials specific to THT by making a change. But this is better than scratch and others. Nette will not start with echo, variables etc ... as you see in the lessons. We'll start from the top.

    What is PHP Key? How to use?
    PHP code is executed by typing this key. If it is written directly without a key, the PHP code in the file will not work.

    <? php
    ...
    ?>

    where; "<? php" is the start key, and "?>" is the end key. "..." will come with our PHP code.

    Without them, our PHP code will not work.

    Usage Shapes Can
    be used in two ways.

    1. <? Php ...?>
    Here, our codes will be entered in the "..." section. If there is an error in the codes, it will be printed on the screen.

    2. <? = "Text"?>
    We can use this in HTML files. echo, print etc ..., we see this as a direct text output command.

    So, <? Php echo 'Text'; ?> instead of <? = "Text"?> is the same function. Without using just the function, we print our text with direct = symbol.

    For example:

    Code:
    E-Mail: <? = $ _ GET ['email']?>
    like ...

    PHP Key in this way I tried to explain simply and quickly.
    See you next lesson
     
  2. barnettl

    barnettl New Member

    People like to watch a lot from a distance, so visuality and video are important
     

Share This Page