Do you want better
IT Services ?

Let our experts help you navigate the digital world with tailor-made IT Solutions!

Table of Contents

PHP SYNTAX

//PHP SYNTAX
<?php

?>

PHP COMMENTS

// This is a Single Line COMMENT
<?php ?>
/* This is a multi Line
Comment.
and it can continue till as many lines
*/

Using Echo

 

As per http://php.net echo — Output one or more strings.

A string is a type of data. A string can contain letters, numbers or characters. Although a string can contain numbers, it is not a numeric value. A string can be short or long.

To display anything on web server, we need to echo. There are some other options available to display content on server, but most of the time echo is used to display content on web browser.

php.net states, echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.

// Lets try some examples
<?php echo "My first test with echo and php!"; 

// The semicolon at the end of the statement is important!

<?php 
// print also works like echo, we will differentiate more
print "Hello World, php sounds easy to me!";
?>

<?php

/* Difference Between print and echo

echo - can output one or more strings
print - can only output one string, and returns always 1

*/

?>

I think that’s enough for a novice for first class. This was just an overview of what php is. We will be learning lot of things ahead.

Next Chapter would cover Variables.

Next Chapter would cover concatenation. We will learn how to do concatenation for two or more strings. I hope you remember what is a string, if not, go through above chapter again.

So today we learned, syntax of php, how to add single line and multi line comments, What is a String, What is echo, what is print, and what is difference between echo and print. I hope you liked this tutorial on getting started guide with PHP.

If you have any questions feel free to drop them in comments.

In between if you are interested in php learning check this post on php training in delhi. We provide both online and offline classes on php, drupal, wordpress training, SEO and HTML/CSS.

WordPress vs A Custom based php Website

WordPress and a custom PHP website are two different approaches to building a website. Here are some differences between the two: Ease of use: WordPress is generally easier to use than a custom PHP website, because it has a user-friendly interface and a large number of plugins and themes that allow you to easily add...

Read More

10 ways to bring targeted audience to your website

Search engine optimization (SEO): Optimizing your website for search engines can help bring targeted traffic from people searching for keywords related to your business. Pay-per-click (PPC) advertising: PPC advertising platforms like Google AdWords allow you to create ads that appear at the top of search engine results pages when people search for specific keywords. Content...

Read More

Top 8 Benefits of Having a Website

Top 8 Benefits of Having a Website Whether you’re a small business or a large corporation, having a website is essential to your success. In today’s digital world, people are used to getting their information online, and if you don’t have a website, you’re missing out on a huge opportunity. A website allows you to...

Read More

What is web hosting and why do I need it ?

Unless you are planning to build a website from scratch, you will need web hosting. Web hosting is a service that provides you with the technology and resources necessary to build and maintain a website. Think of it this way: if a website is like a house, then web hosting is like the land it’s...

Read More

How To Find The Right Website Designer For Your Business

A website is the face of your business – so it’s important that you take the time to find a designer who will create something that accurately represents your company. In this blog post, we’ll explore the process of selecting a designer, what you should keep in mind when hiring one, and how to go...

Read More

A Guide To Why You Need A Dynamic Website

The world has changed. The way people search for things have changed. The way they use technology to do their work have changed. Gone are the days when you create a website and take it as it is, customers will want more information, they’ll want better content, so you need to be ready to provide...

Read More
Scroll to Top
Scroll to Top

We help businesses with Websites, Mobile Applications, Digital Marketing, E Commerce Solutions & Custom Software.