Skip to main content

Posts

Displaying Data

To display the data value of a variable or a string, you can use the command  echo  or  print  .  Different from the second command is a command  print  can behave like a function so that when you try the following script: <?php $Value = print "Learning PHP"; print $value; ?> Then the value that appears is 1. While the echo command more simple and faster because just write something directly to the browser. There is one more commands that can be used to display data to the screen  printf  .  Command  printf  is more complex because we can enter values dynamically and displays data of the type that we want.  For more details, please try the following script: <?php $p=12345; $s=-12345; $d=12/5; $f=162.67-12; printf ("%d <br>",$p); printf ("%d <br>",$s); printf ("%f <br>",$d); printf ("%d <br>",$f); ?> Run on browser. In the above display, the fourth line should...

PHP configuration

The function is used for pushing displays PHP configuration is  phpinfo ()  .  This function will display information related to the PHP configuration that you use.  Because each operating system and web server has different information then this function is often used by programmers to know the configuration of the system also has defined variables and can be used by PHP.  For more details, you can try the following simple programming script: script configuration.php <?php phpinfo(); ?> Next, you can learn   PHP: Data Types and Variables.

Comments in PHP

Comments in PHP intended to provide an explanation for the program that has been written.  Such information will be very useful when other programmers aiming to understand flow program that has been written or make it easier for programmers when it will develop a program that has been created.  There are some signs and patterns that can be used as comments, among others: Style in C ++ -> // Style language C -> /*....*/ Style shell with -> # example:  <? php  echo "Attempted wear comment <br>";  // echo "will not be displayed because this is a comment";  echo "The above line will not be displayed as a comment";  ?> Next, you can learn   Displaying Data PHP.

HTML in PHP

Once you learn  PHP in HTML  , Now you will learn HTML in PHP.  You can also call and use the PHP scripting in HTML tags (  non-embedded program  ).  Syntax is generally  echo "<TAG_HTML>"  ; Examples include the following: <?php echo "<b>Huruf Tebal</b><br>"; echo "<h3>HTML dalam PHP</h3>"; ?> Next, you can learn to   Comment on PHP.

PHP in HTML

Once you learn  PHP script in javascript.   Now you will learn PHP in HTML.  PHP is a programming language embedded program, meaning that PHP language can be inserted into the HTML language.  The server will process existing script between the tags  <? Php  and  ?>  As PHP.  For example, you please open your notepad or notepad ++ then typing the following listings: <html> <head> <title>Welcome At FajarYusuf</title> </head> <body> <?php echo "Selamat datang di pembelajaran PHP FajarYusuf<br>"; echo "Skrip PHP didalam tag HTML"; ?> </body> </html> As in the script above, when the server receives the file and see there is a tag PHP then PHP processing engine that will run it.  Display in the browser will be as follows. l Next, you can learn   HTML in PHP.

PHP scripts in the form of Java Script

Writing standard PHP must start with the tag  <? Php  and ends with  ?>  AAU can be prefixed  <?  and ending  ?>  .  All scripts program that sits between the tags will be processed as a PHP script.  You can also use the style javacript to write a PHP program, for example, as follows: <script language="PHP"> echo "PHP with style JavaScript"; </script> Next you will learn   PHP in HTML.

Storing In Another Folder

Previously you had to learn  writing PHP language  .  Now you will learn to save PHP files in other folders.  You do not need to save PHP files in the subdirectory htdocs, but you can also create and save in other folders.  Mass at latihanPHP directory, see the following picture: To run it, you have to add the new folder name before writing the name of the file to be run.