Simple scripts in php for beginnersHere are some php scripts for beginners to try and practice some simple codes to learn the login and program flow. If you have prior experience of any other programs like C, C++ etc then you can easily understand the program flow and the syntax.In PHP like any other language there are loops, conditions, functions to manage the script. We will be using these functions or syntax to get our desired output. When we use these functions in our tutorials we will keep a hyper link to the tutorial about the particular function. To get the full details about the functions in use visitors can visit those links. Let us start with our first PHP code. Copy the file below to notepad or any other editor and save at root of your localhost or web site as test.php . Then open this page in your server. ( You can read how to open default page of a site here)
You should get Hello Wrold PHP codes are case sensitive . Take care that you don't mix lower and upper case syntax. Every script has two parts, one is about the requirement and the other part is abut the solution. Visitors are requested to first try on their own without visiting the second part for the solution. Printing all the numbers between 1 to 50 Printing all the even numbers between 1 to 50
Php code is kept inside <? and ?> tags , howerver we should start php code with this <?Php and ending tag with ?>
PHP codes are case sensitive . Take care that you don't mix lower and upper case syntax. While linking files or images take care of cases as in many servers file name and its extensions are case sensitive.
What is that echo command inside code block?
How you will print two strings by using single echo command?
This article is written by plus2net.com team.
![]() | ||||||||||||||||||||
| ||||||||||||||||||||