With p p there are two ways to get output.
We can use the Echo or print statement.
Both these output methods are relatively the same.
The main difference is that echo allows multiple parameters in a statement and print does not.
We'll come back to this in a moment echo also execute statements slightly faster than print in this
first example.
We've used an echo statement to output some text contained within the HMO h1 tags the HMO tags must
be contained inside the quotes along with any text
and you can see the output on the right side here.
This is the test header in this echo statement.
Next we have another echo statement with some text followed by an HMO break tag.
So again we're embedding some HMO inside our quotes and you can see the output for that statement.
Here
the third echo statement contains multiple parameters.
We can see each parameter enclosed in quotes followed by a comma so you can see the first parameter.
The second the third and the fourth and they're all connected by both by commas to form a sentence is
seen in the output.
Over here
so the print function does not allow this method with multiple parameters and even using the echo statement.
This is very rarely used.
And lastly we just have an echo statement with the H R tag and that just gives us the horizontal line
as a separator
we can output variables using echo so in this example we declared four variables.
Text 1 Text 2 x and y so text 1 and text to old text strings whereas X and Y or numerical values text
strings of course have to be enclosed in quotations where numerical values do not
in our first echo statement.
Here we have output in the variable text 1 inside each html header tags
in our second echo statement with output in the words I like followed by a variable text to an HMO break
the third echo statement outputs the sum of variable X and Y and so we can see the results of these
three statements.
Right over here this is the first echo statement with the header to tags.
This is the second echo statement in the third.
The third is the sum of X and Y
the next set of examples do the same thing as what we went over above.
Only this time it's using print instead of Echo and as you can see from the output as you go through
the code and also the output on the right side the results are identical.
The only difference is we replaced the word echo with print the statements are the same as well and
so you can go through that and see how there's really not much difference at all.