-3
My teacher gave me a PHP lesson and I swear I understood practically nothing, ask him for help is out of the question mainly because he is very ignorant and does not like when other students ask any kind of question. Here’s the text he sent:
All I could do was code, which didn’t go very far:
<?php
$dados = array('<p>nome: <br>', 'idade: <br>', 'salário: 1500<br>', '<p>ativo', '<p>não ativo');
$bonificacao = ($dados[2] / 100 * 10) + 1500;
foreach ($dados as $funcionario1)
{
$funcionario1[0] . 'Ferdinando';
$funcionario1[1] . '25';
echo $funcionario1;
}
foreach ($dados as $funcionario2)
{
$funcionario2[0] . 'Irineu';
$funcionario2[1] . '40';
echo $funcionario2;
}
foreach ($dados as $funcionario3)
{
$funcionario3[0] . 'Letícia';
$funcionario3[1] . '19';
echo $funcionario3;
}
?>
This was printed on the page:
The funniest part is that he didn’t teach any of this, just showed the arrays, I’ve even complained about this teacher with the coordination, even so, thanks man!
– Eduardo_007
Just to complement. " From PHP 5.4 you can also use the contracted array syntax, which you exchange array() for []" Follow DOC https://www.php.net/manual/en/language.types.array.php
– Marcos Xavier