PHP
PHP: Hypertext Preprocessor) is a computer scripting language,
originally designed for producing dynamic web pages. It is mainly used
in server-side scripting, but can be used from a command line interface
or in standalone graphical applications.
While PHP was originally
created by Rasmus Lerdorf in 1995, the main implementation of PHP is
now produced by The PHP Group and serves as the de facto standard for
PHP as there is no formal specification. Released under the PHP License,
the Free Software Foundation considers it to be free software.
PHP
is a widely-used general-purpose scripting language that is especially
suited for web development and can be embedded into HTML. It generally
runs on a web server, taking PHP code as its input and creating web
pages as output. It can be deployed on most web servers and on almost
every operating system and platform free of charge.[5] PHP is installed
on more than 20 million websites and 1 million servers, although the
number of websites with PHP installed has declined since August 2005.It
is also the most popular Apache module among computers using Apache as a
web server.
To Learn The Basics of PHP , you should read a little bit of PHP basics tutorial is ...Required to run PHPTo be able to run PHP you need a web server .for the first time you have to learn PHP mepersiapkan local server on your PC or laptop to your ...Here will be explained to Air PC OS Windows ( 98 , XP , etc. )You can select multiple angine server such as XAMPP , AppServNetwork , PHP Triad ...Why choose this you can read the previous article .. ( from the tired perasu to install a pernagkatnya ) .1 . XAMPP2 . AppServ3 . PHPTriadchoose
one and install the PC IN anada .. ( and I will not explain the car
installation , because like any ordinary software installed )then
check in broser by entering http://localhost if existing information on
the local server then you have successfully insatl localhost server for
PCs ana ...once
you have the right server to execute PHP code2 and already have a
database ( MySQL ) then you need further Yag is a PHP editorPHP editor could use Notepad , Rapid PHP 2005 Dreamwaver and lain2 depends interest you.
If all is available I AKN explain the basic syntax of PHP
4 kinds of ways of writing PHP code, namely:
1. starting
2. starting
3. starting
4. starting <% end%>
2. starting
3. starting
4. starting <% end%>
Choose one of these four ways. Which is often used is the first and the second way. Each end of the line must always be a semicolon (;).
Same As in other programming languages you can put on the comment line of your program. In PHP way is to put the comment on the right of the sign / / if the comment one line and in between / * and * / if more than one line comments.
/ * If this is a comment
more than one line comment * /
echo ("easy does it ...");
?>
Same As in other programming languages you can put on the comment line of your program. In PHP way is to put the comment on the right of the sign / / if the comment one line and in between / * and * / if more than one line comments.
/ * If this is a comment
more than one line comment * /
echo ("easy does it ...");
?>
Data TypePHP recognize three types of data, namely:
1. integer
2. Floating point number
3. string
integer
Included in this data type is an integer (not disposable coma). example:
$ a = 1234 / / decimal
$ b = - 1234 / / negative
$ c = 0123 / / octal
$ d = 0x12 / / hexadecimal
statements such as $ a = 1234 called assignment statements. In this example the intention is to give the value 1234 to the variable $ a.
Floating point number
Also called fractions. There is a sign which is the dividing point between the spherical part and a fraction.
$ a = 1234 / / regular shape
$ b = 1.2e3 / / exponential form
Strings
$ a = "This is a string data type"
1. integer
2. Floating point number
3. string
integer
Included in this data type is an integer (not disposable coma). example:
$ a = 1234 / / decimal
$ b = - 1234 / / negative
$ c = 0123 / / octal
$ d = 0x12 / / hexadecimal
statements such as $ a = 1234 called assignment statements. In this example the intention is to give the value 1234 to the variable $ a.
Floating point number
Also called fractions. There is a sign which is the dividing point between the spherical part and a fraction.
$ a = 1234 / / regular shape
$ b = 1.2e3 / / exponential form
Strings
$ a = "This is a string data type"
arrayArray is a structured data type is useful for storing large amounts of data of the same type . Parts that make up the array are called array elements , each element can be accessed separately through the array index .One-dimensional array$ city [ 0 ] = " Yogyakarta " ;$ city [ 1 ] = " Jakarta " ;$ city [ 2 ] = " Malang " ;$ city [ 3 ] = " Navan " ;print ( " My favorite town was $ city [ 2 ] " ) ;? >The above code when run in a browser , will appear the words :My favorite is the city of Malang .Array index starts from 0 . So
the array index 0 indicates the first element of the array , the array
index of 1 indicates the second array element , and so on .multidimensional arraysIncluded in this data type is an integer ( not disposable coma ) . example :$ buaht = array (" apple " = > array (" color " = > " red " ," taste " = > " sweet ") ," Banana " = > array (" color " = > " yellow " ," taste " = > " sweet ")) ;print ( " The color is an apple " ) ;print ( $ fruits [ " apple " ] [ " color " ] ) . "" ;print ( " The taste of banana is " ) ;print ( $ fruits [ " banana " ] [ " taste " ] ) ;? >The above code will result in postsApple fruit color is redThe taste is sweet bananaVARIABLEIn any PHP variable name prefixed dollar sign ( $ ) . For example, a variable namewritten in PHP with $ a. Type of a variable is determined by the time course ofprogram and depending on the context used .Contoh2.php file :$ a = " 5 " ;$ b = " 2 " ;$ result = $ a + $ b ;echo ( $ result ) ;? >the result is : 7CONTROL STRUCTUREIFIF construction is used to execute a conditional statement .How writing is as follows :if ( condition ){statement}or :if ( condition ){statement}else{another statement}or :if ( first condition ){The first statement}elseif ( second condition ){The second statement} else{another statement}
Post a Comment