Use Of PHP Semicolon in code



In this you will learn about use of PHP semicolon in code and how to define variable in PHP.

PHP Semicolon ;

PHP commands ends with a semicolon. If you don’t use semicolon in the end of command than it will cause PHP to treat multiple statements like one statement, finds itself unable to understand it and produce a “Parse error” message.

The $ symbol in PHP

For defining a variable in PHP you must use $ in front of variables. Your variable can be number strings or arrays.

Example : Use of semicolon in php code and defining PHP variable

<?php
$counter = 1;
$string=”world”;
$array= array(“One” “Two” “Three”);

?>


Share on Google Plus

About Rahul Rana

I am an experienced web designer and SEO expert. I am running my own online marketing company i.e "SEO To Web Design". Thanks for reading, keep sharing online marketing and web design knowledge.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment

Enter your email address:

Delivered by FeedBurner