Source: levelup.gitconnected.com

PHP 7.x — P3: Variables Intro

Category: PHP

You might remember that there are these things called x and y variables that used to store numbers.

Just substitute 2 for x and 5 for y and you get 7.

First, we’ll assign the string to the $name variable and then concatenate it to the “Hi my name is” string. You can’t just place the variable next to the string and expect PHP to understand that you want to join the two strings.

You can change the value of the $name variable to whatever you want and it will automatically update the output.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners