0% found this document useful (0 votes)
40 views2 pages

Variabileinphp

1) Double quotes " " will output the value of a variable, while single quotes ' ' will output the text between the quotes. 2) The \n tag can be used to start a new line when outputting text. 3) The \t tag can be used to insert a tab space when outputting text. 4) The . operator can be used to concatenate strings together into a single variable for output.

Uploaded by

thunder_b
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

Variabileinphp

1) Double quotes " " will output the value of a variable, while single quotes ' ' will output the text between the quotes. 2) The \n tag can be used to start a new line when outputting text. 3) The \t tag can be used to insert a tab space when outputting text. 4) The . operator can be used to concatenate strings together into a single variable for output.

Uploaded by

thunder_b
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Daca intr-o variabila folosim gilimele se va afisa continutul variabilei, iar daca folosim apostrofuri se afiseaza sirul dintre

apostrofuri. Exemplu 1: $age = 12; $result1 = $age; $result2 = $age; echo $result1; echo <br>; echo $result2; Se va afisa 12 $age Exemplu 2: $number = 10; $string1 = There are $number people in line.; $string2 = There are $number people waiting.; echo $string1,<br>\n; echo $string2; se va afisa: There are 10 people in line. There are $number people waiting. Saltul la o noua linie se face folosind tagul \n: $string1 = String in \ndouble quotes; $string2 = String in \nsingle quotes; Echo $string1; Echo$string2; Se va afisa String in double quotes and string2 outputs as String in \nsingle quotes Inserarea unui spatiu similar cu Tab se face folosind tagul \t: $string1 = String in \tdouble quotes; $string2 = String in \tsingle quotes; Echo $string1 Echo $string2 Va afisa String in double quotes String in \tsingle quotes Operatorul de concatenare: $string1 = Hello; $string2 = World!; $stringall = $string1.$string2; $stringall = $string1. .$string2; echo $stringall; Se va afisa HelloWorld! Hello World! Putem folosi atribuirea cu operatorul . pentru a concatena la o variabila sir de caractere alt sir

.=
$stringall = Hello; $stringall .= World!; echo $stringall; se va fisa Hello World

You might also like