🚧 Roadmap Em construção... 🚧
Delimitadores de código
en-US
PHP code must be written inside the code delimiters as if the code is outside the delimiters it will not be interpreted.
pt-BR
O código PHP deve ser escrito nos delimitadores de código, pois se o código estiver fora dos delimitadores não será interpretado pelo php.
<?php
Aqui vai todo nosso código PHP
Here goes all our PHP code
?>
Comentários
en-US
Comments, serves to pass some information about our code, or describe something about the classes, but we must be very careful with comments, not to get that code full of comments, and comment only when necessary.
pt-BR
Comentários serve para passar alguma informação sobre nosso código, ou descrever algo sobre as classes, mas devemos tomar muito cuidado com os comentários, para não ficar aquele código cheio de comentários, e comentar somente quando necessário.
<?php
// Comentario de uma uníca linha
// Single line comment
# Comentario de uma uníca linha
# Single line comment
/**
* Comentarios de
* Multiplas linhas
**/
/**
* multiline
* comment
**/
?>
Comandos de saída
pt-br
São usados para gerar uma saída em tela (OUTPUT).
- Linhas de comando executadas no
prompt do sistemasua saída será no proprio console. - Linhas de comando executadas no
servidor web - Apache, NGINX ou IISsua saída será no propria pagina HTML.
en-us
They are used to generate an output on the screen (OUTPUT).
- Command lines executed in the
system promptwill be output in the console itself. - Command lines executed on the
web server - Apache, NGINX or IISwill be output in the HTML page itself.
pt-br
echo É um comando usado para imprimir uma ou mais string na tela.
<?php
echo 'Hello World';
?>
Output Hello World
en-US
echo Is a command used to print one or more strings to the screen.
<?php
echo 'Hello World';
?>
Output Hello World
pt-br
var_dump Explana todo conteúdo de uma variável, mostrando toda estrutura sobre uma ou mais
Expressão, incluindo o tipo e o valor
<?php
$user = [
"fisrt_name" => "Allan",
"last_name" => "Rodrigues"
];
var_dump($user);
?>
Output
array(2) {
["first_name"]=>
string(5) "Allan"
["last_name"]=>
string(9) "Rodrigues"
}
en-US
var_dump Explains the entire contents of a variable, showing the entire structure over one or more
Expression, including type and value
<?php
$user = [
"fisrt_name" => "Allan",
"last_name" => "Rodrigues"
];
var_dump($user);
?>
Output
array(2) {
["first_name"]=>
string(5) "Allan"
["last_name"]=>
string(9) "Rodrigues"
}
pt-br
print_r Explana todo conteúdo de uma variável igual ao var_dump, mas em um formato mais legivel e suprimindo os dados.
<?php
$user = [
"fisrt_name" => "Allan",
"last_name" => "Rodrigues"
];
print_r($user);
?>
Array
(
[fisrt_name] => Allan
[last_name] => Rodrigues
)
en-US
print_r explain all contents of a variable like var_dump, but in a more readable format and suppressing the data.
<?php
$user = [
"fisrt_name" => "Allan",
"last_name" => "Rodrigues"
];
print_r($user);
?>
Array
(
[fisrt_name] => Allan
[last_name] => Rodrigues
)
Top comments (0)