Now that you learned how to declare variables and concatenate them let’s make a simple exercise and use what we learned in the last tutorials to generate a message that the server will output to the browser:
script
Concatenation
The process of concatenation consists of joining two or more variables separating them with a dot. Suppose you want to echo out the following “My age is 25”, you can do it this way:
<?php
$text = “My age is”;
$age = 25;
Variables in php
Hello again, today i decided to write some basic concepts about php as a programming language and the first thing i want to talk about are the variables.
First thing that you should know is that when you declare a variable you need to put the dollar ( $ ) sign before your variable ex: $x;
Your first php script
Now that you installed xampp it’s time to set up your project and write your very first php script.
First go to the server root path ( if you remember from the installing and setting up xampp post ) and inside it create a new folder, i will name it “tryphp”. Be careful with that name because it will be important in the future, i recommend to not use spaces or any kind of special characters