Is there a website or PDF with exercises for handling arrays?

Asked

Viewed 88 times

0

I wanted to know if you know any site or have Pdfs or anything else that has exercises with functions for handling arrays in PHP.

I went to Sopt, because I searched a lot on the internet and I didn’t get results.

If you have, please pass me; I need for a test.

  • 1

    The official manual is very good! http://php.net only has some bad things translated that it is nice to give a Google even.

  • But the manual only teaches how to use, it doesn’t offer exercise. That’s the problem :/

  • Make these http://professor.leonardomeirelles.com/wp/wp-content/uploads/2017/04/Lista-de-Exerc%C3%Adcios-Array1.pdf

1 answer

1

Array I thought it was a seven-headed bug, but it’s just simple powerful variables.

A normal variable can save my name, for example:

$nome = "Lucas";

If we give a echo what will be shown is:

Lucas

Ja com array, that’s what I said, are "variables" only they keep more information.

For example, you can save my name and surname:

$nomeSobrenome = ["Lucas"];
$nomeSobrenome = ["Carvalho"];

As I wrote above, she created 2 spaces, that is, starting from 0, she created 0 and 1. Same thing if I had created two different variables. If I give a echo $nomeSobrenome[0] . " " . $nomeSobrenome[1], the point in the middle there, serves to concatenate, ie to add/integrate two information in the same command, without having to give a lot of echo, and the space I gave there, with the quotes, is to give space between the commands. It’ll show like this at the end:

Lucas Carvalho

Instead of integers in the indices of arrays, you can also query them by strings:

$pessoa = ["nome" => "Lucas de Carvalho Alves"];

If I give an echo $pessoa['nome'];

Will display Lucas de Carvalho Alves This is because "name" received "Lucas de Carvalho Alves" by the sign of => (arrow) is kind of a sign only of equal = , in this case, it is an entrustment signal.

There is not much secret, it is only create your own exercises, and go practicing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.