Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)

<?php 
function func($x, $y) {
	
echo " until change: $x, $y"."\n";

$num=$x;
$x=$y;
$y=$num;

echo "result: $x, $y";
}
func(2,1);

\\ result-- until change: 2----1, result:1-----2
by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0

<?php 
function numbers ($x) {
       if ($x > 0) {
                echo "number is positive";
       } else if ($x == 0) {
                echo "number is zero";
        } else {
                echo " number is negative";
         }
}
echo numbers(256); \\ result-- number is positive
echo numbers(0); \\ result-- number is zero
echo numbers(-123); result-- number is negative
by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0

<?php
 
function code($code) {

$x=strlen($code);

if ($x == 4) {
              echo "true";
        } else if ($x==6) {
              echo "true";
        } else {
              echo "false"
     }
}

echo (code(1234)); \\result-true
echo (code(a4b56r)); \\result-true
echo (code(t674rhedbt8w39); \\result-false
by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0

<?php
function number($x) {

if ($x % 2) {
               echo " even";
        } else {
              echo "odd";
    }
      echo (number(100)); \\result- even
      echo (number(23));\\ result- odd
}


by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0
/*SRT_PAD function returns the string padded on the left, the right, or both sides to the specified padding length. If the optional argument pad_string is not supplied, the string is padded with spaces, otherwise it is padded with characters from pad_string up to the limit.*/ <?php // Multiplication table for ($h=1; $h<=10; $h++){ for ($v=1; $v<=10; $v++){ if ($v==1){ echo str_pad($v*$h, 2, " ", STR_PAD_LEFT);} else{ echo str_pad($v*$h, 4, " ", STR_PAD_LEFT); } } echo "\n"; } ?>
by Anna Tukvadze
2 years ago
0
PHP
Multiplication table
0

<?php
function beautiful($o) {
return substr_count($o, 010);
}

print_r (beautiful(0100100100100100111010101001011010); //output- 6
by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0

<?php
function calculatescore($x) {
return [
    substr_count($x, 'Y'), //substr_count-Counts how many times this data is given
    substr_count($x, 'O'),
    substr_count($x, 'U')
     ];
}
print_r (calculatescore("YOU")); // 1,1,1
print_r (calculatescore("YYOOUU)); //2,2,2
print_r (calculatescore("UUUOOYYYY)); //3,2,4
by Gvanca Gharibashvili
2 years ago
0
PHP
Object Oriented PHP Tutorial
0
function getExtension($file){
	$exts = [];
	foreach($file as $f){
		$info = pathinfo($f);
		//print_r($info);
		$exts []= $info['extension'];
	}
	return $exts;
};

print_r(getExtension(["ruby.rb", "cplusplus.cpp", "python.py", "javascript.js"]));
print_r(getExtension(["code.html", "code.css"]));
by Guram Azarashvili
2 years ago
0
PHP
Solutions
0
Create a function that takes two arguments. Both arguments are integers, a and b. Return Found if one of them is 10 or if their sum is 10. Otherwise, return Not found.
by Tinatin Kvinikadze
2 years ago
0
PHP
Problem Solving
0
Write a function that returns the length of a string. Make your function recursive.
by Tinatin Kvinikadze
2 years ago
0
PHP
Problem Solving
0
Results: 1580