variables in php
Variables in PHP
A variable is a name given to a memory location. A variable is used to store value. We can change the value stored in the variable.
In other words we can say that variable is a container for storing information/data/value.
Creating variable
In PHP we create variable using the $ sign. Consider the following example:
$n1=100;
$n2=200;
$name="C Institute";
After the execution of the statements above, the variable $n1 will hold the value 100, the variable $n2 will hold the value 200, and the variable $name will hold the value C Institute.
Note: The variables declaration is terminated by semicolon. In fact every statement in PHP script must be terminated by ; except the last statement.
Rules for creating variable name
• A variable starts with the $ sign.
• A variable name must start with an alphabet or the underscore character.
• A variable name cannot start with digit.
• A variable name can only contain alpha-numeric characters and underscores (A-Z,a-z, 0-9, and _ )
• Variable names are case-sensitive ($roll and $Roll are two different variables)
Accessing Variable
When you want to access the variable, you will also use $ before variable name. Eg. In the following example we are assigning and displaying the value of variable $age.
$age=10;
echo $age;
Change the value of variable
When we reassign value into variable, then its value is updated:
$a=10; #a stores 10
Echo $a;#prints 10
$a=20;#value of a is updated
Echo $a;#prints 20
Note: In php variables do not have any fixed data type. PHP automatically associates a data type to the variable, depending on its value.
However, in PHP7 and above type declarations are added.
#tarunsir #phptutorial #learnprogramming
www.tarunsir.com
www.cinstitute.org.in
Connect me on linkedin https://www.linkedin.com/in/tarrunverrma
https://www.instagram.com/the_ultimate_coding_stuff/
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «variables in php», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.