Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
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
3 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
3 years ago
0
PHP
0
HTML დამწყებებისთვის
HTML დამწყებებისთვის
by gocha akhalbedashvili
3 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
3 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
3 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
3 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
3 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
3 years ago
0
PHP
Comment Types
PHP
PHP comments
PHP official doc
0
String Variable Type
/* String variable type - also called alphanumeric variables or character variables;
   have values that are treated as text;
*/ 
Integer Variable Type
 # Integer Variable type - Integers are whole numbers that can be positive, negative, or zero
Float Variable Type
 /* Float Variable type - is a data type composed of a number that is not an integer. 
    it includes a fraction represented in decimal format;
*/
Boolean Variable Type
 # Boolean Variable Type -  can either be True or False; 
Array Variable Type
// Array Variable type -  is a data type that represents a collection of elements.
by Mariam Gelkhauri
3 years ago
0
PHP
PHP
Variable Types
Variables
Object Oriented PHP Tutorial
0
Do While Loop
The do...while loop will always execute the block of code once, check the condition, and repeat the loop as long as the specified condition is true.
$i = 1;

do {
    echo "My name is Nia" . "\n";
    
    
} while ($i < 0); 
by Elena Kuparadze
3 years ago
0
PHP
Loop
0
Results: 1578