This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 10; | |
$y = 8; | |
if ($x > $y) { | |
echo "$x è maggiore di $y"; // Output: 10 è maggiore di 8 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
phpinfo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 127; // 1111111 | |
$y = 85; // 1010101 | |
var_dump(decbin($x & $y)); // Output: string(7) 1010101 | |
var_dump(decbin($x | $y)); // Output: string(7) 1111111 | |
var_dump(decbin($x ^ $y)); // Output: string(6) 101010 | |
var_dump(decbin(~ $x)); // Output: string(64) 1111111111111111111111111111111111111111111111111111111110000000 | |
var_dump(decbin($x << 1)); // Output: string(8) 11111110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$score = 300; | |
if ($score >= 200 && $score <= 400) { | |
echo "Hai vinto il peluche medio"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 10; | |
$y = "10"; | |
var_dump($x == $y); // Output: boolean true | |
var_dump($x === $y); // Output: boolean false | |
var_dump($x != $y); // Output: boolean false | |
var_dump($x !== $y); // Output: boolean true | |
var_dump($x < $y); // Output: boolean false | |
var_dump($x > $y); // Output: boolean false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 9; | |
$y = 2; | |
echo $x + $y; // 0utput: 11 | |
echo $x - $y; // 0utput: 7 | |
echo $x * $y; // 0utput: 18 | |
echo $x / $y; // 0utput: 4.5 | |
echo $x % $y; // 0utput: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 30; | |
echo $x."\n"; // Output: 30 | |
$x += 30; | |
echo $x."\n"; // Output: 60 | |
$x -= 20; | |
echo $x."\n"; // Output: 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = "Ciao mondo!"; | |
echo strlen($string)."\n"; // Output 11 | |
echo strpos($string, 'mondo')."\n"; // Output 5 | |
echo substr($string, 5, 5)."\n"; // Output mondo | |
echo str_replace('mondo', 'a tutti', $string)."\n"; // Output Ciao a tutti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$lastName = "Biscaldi"; | |
echo $lastName[0]; | |
echo $lastName[3]; | |
echo $lastName[4]; | |
// Output Bca |