Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Wednesday, July 2, 2014

Variable usage, echo, and PHP comments

Variable usage, echo, and PHP comments

Posted by: Mario norman valid Monday, October 1, 2012
Bismillahirohmanirohim

php variable


Earlier in the post PHP [INTRODUCTION] we've previously acquainted with PHP. Now we will get acquainted with the variables in PHP. Variable used to store a value, how:
Namavariable = $ value;
variable name must begin with a dollar sign ($) and do not forget to end with a semicolon (;).
* Remember the name of the variable must begin with the letter or sign the underscore (_).
* Variable name is more than one word can be connected with sign an underscore (_).

after understanding to create a variable in php, we will show the variable with the "echo". Echo is used to display text, strings, and variables into the browser. Below is a way to display text and variables with echo.
echo dan variable








careful when writing with two quotes (quotes) in the echo, because the quote mark the beginning and end of text marker or string using echo. For writing two quotes could use the way below.
penggunaan tanda quote
way 1

penggunaan tanda quote
2 ways
code error
wrong way















the third picture when colleagues write code like that, there will be an error.

to display the variable with echo two quotes are not necessary, just with a dot (.) to connect with a text variable or string that is in the two quotes.
variable dan echo
how to display variable

o yeah one more .... the use of comments in PHP, comments will not be molded into a web browser.
how to add a "/ /" (without the quotes) in front of his comments. This is to add a comment in one line only. While the / * ..... * / add comments consisting of several lines.
komentar dalam php
use comments

well, for now it used to be .... there are many more to be learned .... wait for the next post ya ...
next we will learn about operator in PHP .
may be useful ..... (: