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 | |
$a = $b = 10; | |
$name = "Maykon"; | |
$name2 = "Joselita"; | |
// Igual | |
$a == $b |
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 | |
// Soma | |
$a = 1 + 2; | |
$total = $a - 1; | |
// Total is 2 | |
// Negacão | |
$b = -$a; |
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 | |
// Define two constants | |
define('FOO', 2014); | |
define('FOO_BAR', 'Sea food'); | |
// To print a constant, we have not to use $ | |
echo FOO; |
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 | |
// Array | |
$fruits = array('Apple', 'Orange', 'Pineapple'); | |
// Array key-value | |
$data = array( | |
'first_name' => 'Maykon', |
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 | |
// Boolean | |
$foo = true; | |
echo $foo; | |
// Integer | |
$width = 1024; | |
$height = 768; |
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 | |
class Post | |
{ | |
public function getPost() | |
{ | |
/* | |
This code will be ignored because it's commented | |
$a = 8; | |
echo $a; |
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 | |
class Post | |
{ | |
public function getPost() | |
{ | |
// Inline comment | |
$a = 10; | |
// This method will return an int 10 |
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
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="description" content="short page description, to improve search engines"> | |
<meta name="keywords" content="short keywords, separated by comma"> | |
<title>My blog</title> | |
</head> | |
<body> | |
<h1> | |
<?php echo 'Meu nome é: '; ?> |
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
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="description" content="short page description, to improve search engines"> | |
<meta name="keywords" content="short keywords, separated by comma"> | |
<title>My blog</title> | |
</head> | |
<body> | |
<h1>My first post</h1> | |
<h2>Starting HTML</h2> |
NewerOlder