Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
for ციკლი
const money = [`dollar`, `euro`, `Sterling`, `Bitcoin`]; for (let i = 0; i < money.length; i++) { console.log(money[i]); } /* output : dollar euro Sterling Bitcoin*/
by Bakari Datiashvili
3 years ago
0
JavaScript
Array
for loop
JavaScript
0
Comparison between PHP and JS "problem solving" moduls (6) CODE
/* JavaScript is a case senitive language when it comes to variables, function and class declarations, while PHP is not case sensitive in function and class declarations. */
function writeMsg() {
  console.log("hello world")
}
WRITEMSG();
// outputs reference error
function writeMsg() {
  echo "Hello world";
}
WRITEMSG();
// outputs Hello world
by Luka Khitaridze
3 years ago
0
JavaScript
PHP
Syntax
0
switch(ball)
const balls = ball =>{ switch(ball) { case `კალათბურთი`: console.log(`${ball} კალათბურთის ბურთია`); break; case `ფეხბურთი`: console.log(`${ball} ფეხბურთის ბურთია`); break; case `რაგბი`: console.log(`${ball} რაგბის ბურთია `); break; default: console.log(` არ არის არც კალათბურთის არც ფეხბურთის არც რაგბის ბურთი `); } } balls(`ტენისი`);
by Bakari Datiashvili
3 years ago
0
JavaScript
switch
JavaScript
0
Comparison between PHP and JS "problem solving" moduls (5) CODE
// Unlike JS, in PHP all variables are local in scope unless declared as global. so both languages are just opposite in declaring variables.
let x = 5;
let y = 3;
function sum() {
    console.log(x + y);
}
sum(); 
//outputs 8 in JavaScript,
$x = 3;
$y = 5;
function sum() {
    echo $x + $y;
}
sum();
//outputs error unless declaring variables
by Luka Khitaridze
3 years ago
0
JavaScript
PHP
Variables
0
In first case 'result' will be 'false' because && operator executes first and result will be assign to 'result'. Like this: $result = ("First" && false);

$result = "First" && false;
var_dump($result);
result will be 'First', because first executes $result = "First" and next execute AND operator. Like this: ($result = "First") && false;

$result = "First" AND false;
var_dump($result);
by Nika Kobaidze
3 years ago
0
PHP
operator priority
PHP official doc
0
Assign multiple variables
Assign multiple variables:

$a = $b = $c = 10;
echo "a = $a, b = $b, c = $c";

$person = ['Nika Kobaidze', 34];

[$name, $age] = $person;

echo "My name is: $name I'm $age years old";
by Nika Kobaidze
3 years ago
0
PHP
PHP official doc
0
by nikoloz nachkebia
3 years ago
0
PHP
String functions
1
Comments
<?php
// You can also use comments to leave out parts of a code line
$x = 5 /* + 15 */ + 5;
echo $x;
?>
# this is single-line comment
// tshi is another single-line comment
/* this is for  
multiple-lines 
comment 
block
*/
by otar datuadze
3 years ago
0
PHP
0
Arithmetic Operators
<?php
$number1 = 9;
$number2 = 4;
echo $number1 - $number2 . "\n";
echo $number1 + $number2 . "\n";	
echo $number1 / $number2 . "\n";
echo $number1 * $number2 . "\n";
echo $number1 % $number2 . "\n";
/* Result
5
13
2.25
36
1
*/
by otar datuadze
3 years ago
2
PHP
Arithmetic Operators
0
<?php
$my_name = "oto";
$my_weight = 70; //kg
$my_height = 177; //m

$his_name = "guduna";
$his_weight = 77;
$his_height = 200;

if ($my_weight < $his_weight) {
  echo "hi is fatter!  ";
}


if ($my_height < $his_height) {
	echo "hi is taller!";
	
}
by otar datuadze
3 years ago
0
PHP
if statement
0
Results: 1578