Web Development-How to Write Your First PHP Program Very Easily!!

in #php7 years ago

Advanced programmers understand a secret. The secret that they are aware of relates to how a PHP application is constructed.

php-151199_960_720.png
source

Here is the secret:

"Complex packages are built up from easy programs. If you can research how to create a simple program, you can study how to construct a complex program, no be counted how complicated."

coding-699318_960_720.jpg
source

A software can be constructed of solely a few lines. They constantly start the same way. Start with the PHP start tag, accompanied by your programming code, and ultimate through the PHP cease tag.
code-944504_960_720.jpg
source

Example 1:
Line 1: <php
Line 2: // your program goes here
Line 3: ?>

The personal homepage application shown above has only three lines. Line 1 & 3 are the begin and end tags, line 2 is your practical code. In this example however, line 2 is a comment and will now not perform any unique action aside from to remind you of something. Feedback isn't processed with the aid of the interpreter. Once a remark is encountered, it is essentially left out.

Example 2:
Line 1: <php
Line 2: // this is one comment
Line 3: // this is another comment
Line 4: // this is the last comment
Line 5:?>

The code in example 1 behaves exactly because of the code in example 2. Despite the fact that example 2 has 2 more traces. If you observed, the additional lines in example 2 are best remarks. Once more they are overlooked via the Hypertext Preprocessor interpreter (Hypertext Preprocessor Engine).

If there's one comment or more than one feedback, the interpreter will act the same way. It's going to forget about any remarks that it reveals.

Example 3:
Line 1: <php
Line 2: // below this line is a real PHP programming command
Line 3: echo 'My First Real Program';
Line 4:?>

In example three you'll see your first functioning php software. The 'echo' command was added to this program, located on-line three. An 'echo' declaration is a constructed in php command in order to output whatever follows it to the screen. Anytime you want to output something the usage of the personal home page to the display screen, net browser, or visible display. Use the simple 'echo' command.

As you may see, the phrases 'My First real software' follows the 'echo' command. It's far very vital to enclose the words that you want 'echoed' at the display screen inner single or double charges. This way the echo command knows from what man or woman to start with, and
what man or woman to give up with, as it generates the output to the screen.

When the echo command is known as it takes the contents of the fees and sends it out to the display screen - minus the quotes. So the output would be:
My First Real Program
Example 4:
Line 1: <php
Line 2: // the next line is the first echo command
Line 3: echo 'You are ';
Line 4: // the next line is the second echo command
Line 5: echo 'learning how to ';
Line 6: // the next line is the last echo command
Line 7: echo 'program in PHP.';
Line 8:?>

The output to this program would be:
You are learning how to program in PHP

When you begin programming, there is no restrict to how many feedback and instructions you could enter on your application. Move in advance, try it yourself. As you get better you won't want so many feedback to remind you of what you are doing in your software.

Complex packages are made up of simple programs. Learning how to mix easy instructions together, along with PHP begin and stop tags makes a totally functioning PHP program. As you are learning, a proper suggestion is to add as many remarks as you want to help have in mind what you are doing. Comments are like taking notes that you can refer lower back too. As you get better at programming, you will naturally enter fewer comments. The PHP 'echo' command outputs characters to the screen. Enclose all characters after an 'echo' command with single or double quotes.

Congratulations, you simply wrote your first PHP program.


This is for Today
Thank you dear steemian's for your interested & visiting here.....
Stay tuned &Please Follow me @enzolena 😉
Love You Friends😊
Have a nice day

Sort:  

This publication has registered to the writing contest thanks to @enzolena.

For more information, click here!!!!

See the Minnowhelper contest conditions here

Do you know, you can also earn passive income after every bidding round simply by delegating your Steem Power to @minnowhelper?
you can delegate by clicking following links: 10 SP, 100 SP, 500 SP, 1000 SP or Another amount

Thanks for this nice contest...
♥️

This post has received a 2.61% upvote from thanks to: @enzolena.
For more information, click here!!!!

If you use our Robot before your post has 1 day and get an Upvote greater than 1%, you will automatically receive Upvotes between 1% and 10% as a bonus from our other robots.

Do you know, you can also earn passive income after every bidding round simply by delegating your Steem Power to @minnowhelper?
you can delegate by clicking following links: 10 SP, 100 SP, 500 SP, 1000 SP or Another amount

Help support @minnowhelper and the bot tracker by voting for @yabapmatt for Steem witness! To vote, click the button below or go to https://steemit.com/~witnesses and find @yabapmatt in the list and click the upvote icon. Thank you.

Voting for @yabapmatt

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Naeem from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.25
TRX 0.25
JST 0.040
BTC 94006.35
ETH 3379.28
USDT 1.00
SBD 3.47