Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Variables are used to store data, like string of text, numbers, etc. Variable values can change over the course of a script. Here're some important things to know about variables: 1. In PHP, a variable does not need to be declared before adding a value to it. PHP automatically converts the variable to the correct data type, depending on its value. 2. After declaring a variable it can be reused throughout the code. The assignment operator (=) used to assign value to a variable. Naming Conventions for PHP Variables These are the following rules for naming a PHP variable: All variables in PHP start with a $ sign, followed by the name of the variable. A variable name must start with a letter or the underscore character _. A variable name cannot start with a number. A variable name in PHP can only contain alpha-numeric characters and underscores (A-z, 0-9, and _). A variable name cannot contain spaces.
by Gigi Butchvelashvili
2 years ago
0
PHP
Variable
0
Line1
Hello world, This is sample text
Line2
Hello, world What's going On
We want to search string that contains:
world & going
words VISUAL STUDIO Example:
STEP 1: Press CTRL + F (Open find dialog)
STEP 2: Press ALT + R (Use Regular expression)
STEP 3: Write 
world(.*)going
in the search field
The search result will be:
Hello, 
world
What's
going
On
because it contains the same time words "world" and "going"
by Luka Tatarishvili
2 years ago
0
0
If Statement CODE
`If string value(number) is less than 5 returns "Your number is less than 5!"

$st = strlen("game"); // returns 4

if ($st < 5 ) {
	echo "Your number is less than 5!". "\n";
` if number is more than 5, but less than 10 returns: } elseif ($st < 10) { echo "Your number is less than 10!". "\n";
`
And finally, if the number is higher than 10 returns:

	} else {
		echo "Your number is out of the range:("."\n";
	}
`
by Gigi Butchvelashvili
2 years ago
0
PHP
IF statement
0
Variables
<?php $minNumber = 1; $maxNumber = 100; $sum; function myCounter(){ global $minNumber,$maxNumber, $sum; $sum= $minNumber + $maxNumber; // if i want to use global variables in function must use global or GLOBALS[] } myCounter(); echo $sum; // output 101 ?>
by Mikheili Maglaperidze
2 years ago
0
PHP
0
HTML დამწყებებისთვის
HTML დამწყებებისთვის
by gocha akhalbedashvili
2 years ago
1
HTML
beginner
HTML Tutorial for Beginners
0
Php operators
$a=2; $b=$a++; what is the value of b? There is a difference between prefix and postfix operator. prefix operator :: first increase(/decrease) 'a', then update 'b'. For $a=2 ; eg.. $b=++$a First increase $a =3 (i.e. a=a+1) Now update $b= 3 (i.e. b=a) Output --> $b= 3 --------------------------------------------------------------- postfix operator :: first update 'b' then increase(/decrease) 'a'. For $a=2 ; eg.. $b=$a++ first update $b =2. (i.e. b=a) Now increase $a= 3. (i.e. a=a+1) Output --> $b= 2
by Mikheili Maglaperidze
2 years ago
0
PHP
0
Array Types in PHP
The are 3 types of Arrays in PHP : Numeric Array, Associative Array and Multidimensional Array.
<?php

//Numeric Arrays

    $names = array("Mate", "Giorgi", "Davit");
    echo $names[1] . "\n"; 
    
    $names[0] = "Mate";
    $names[1] = "Giorgi";
    $names[2] = "Davit";
    
// Associative Arrays

$people = array("Mate"=>"30", "Giorgi"=>"32", "Davit"=>"36");
// or
echo $people['Mate'] = "30" . "\n";
echo $people['Giorgi'] = "32" . "\n";
echo $people['Davit'] = "36" . "\n";

//Multi-Dimensional Arrays

$PEOPLE = array (
    'Women' => array('Natalia', 'Elena', 'Inga'),
    'Men' => array('Mate', 'Giorgi', 'Zura'),
    'Kids' => array('Nia', 'Sofia', 'Rezi')
    );
    
echo $PEOPLE['Kids'][0] . "\n"; 
echo $PEOPLE['Men'][2] . "\n";
echo $PEOPLE['Women'][1];

?>
by Elena Kuparadze
2 years ago
0
PHP
Arrays
0
While Loop
The while loop executes a block of code as long as the specified condition is true.
$i = 1; 
  while ( $i < 40 ) {
    echo "I am " . $i . " years old" . "\n";
    $i ++;
}
by Elena Kuparadze
2 years ago
0
PHP
Loop
0
Example:
<?php

 // Variables
   $my_name = "Mariam";
   $my_weight = 70; //kg
   $my_height = 1.77; //m
   $live = "Tbilisi";

 # About me
    echo 'My name is '.$my_name.', I am '.$my_weight.'kg and my height is '.$my_height.', I live in '.$live.'.';

?>
by Mariam Gelkhauri
2 years ago
0
PHP
PHP
Variables
0
/* ........... .............. .............. */
/* 
for multiple-line comment
this is also a comment block 
and this one too 
*/
// and #
// this is for Single line comment
# also For a single-line comment 
/*... */
 # - /*... */ For inline comment
     $sum = 9 /* maybe + 16 */ + 17;
     echo $sum;
by Mariam Gelkhauri
2 years ago
0
PHP
Comment Types
PHP
PHP comments
PHP official doc
0
Results: 1580