Skip to content

Commit fad3e9b

Browse files
committed
doc cleanup
1 parent 3a139f5 commit fad3e9b

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

exercises/have-the-last-say/problem/problem.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,30 @@ Create a program that reads a CSV file using `fgetcsv` and change the delimiter
22

33
The first argument is the file name of the CSV which you should read.
44

5-
The CSV file contains two columns separated with `|` (the pipe operator). The first column is `country`
6-
and the second column is `capital`. You should print each row to the console like the
7-
following (with a new line after each row):
5+
The CSV file contains two columns separated with `|` (the pipe operator). The first column is `country` and the second column is `capital`.
6+
7+
You should print each row to the console like the following (with a new line after each row):
88

99
```
1010
Country: Austria, Capital: Vienna
1111
```
1212

1313
The list of countries will be picked at random, so the CSV will be different each time your program runs.
1414

15-
When using `fgetcsv` there's a bunch of arguments which change the behaviour of the way the CSV is parsed. In our case we
16-
want to change the `separator` argument, which defaults to a comma `,`. We need it to be the
17-
pipe `|` character.
15+
When using `fgetcsv` there's a bunch of arguments which change the behaviour of the way the CSV is parsed. In our case we want to change the `separator` argument, which defaults to a comma `,`. We need it to be the pipe `|` character.
1816

19-
We don't want to specify the rest of the arguments, so aside from the file pointer which is the first argument,
20-
we only want to specify the `separator` argument.
17+
We don't want to specify the rest of the arguments, so aside from the file pointer which is the first argument, we only want to specify the `separator` argument.
2118

2219
Named arguments are a great way to change argument default values without having to specify all the defaults again.
20+
2321
For example, if you only want to change the value of the last argument to a function,
24-
you can do so, without specifying all the other arguments. For example:
22+
you can do so, without specifying all the other arguments:
2523

2624
```php
27-
htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
25+
htmlspecialchars($string, ENT_COMPAT | ENT_HTML, 'UTF-8', false);
2826
```
2927

30-
We only want to change the last argument (double_encode) of the function to false (the default is true). However,
31-
we are forced to specify all the other arguments, but they have not changed from the defaults.
28+
We only want to change the last argument (double_encode) of the function to false (the default is true). However, we are forced to specify all the other arguments, even though they have not changed from the defaults.
3229

3330
Named arguments allows to write the same, but in a more succinct fashion:
3431

@@ -52,8 +49,7 @@ You will need to open the file for writing before using `fgetcsv` you can do tha
5249

5350
You will most likely need a loop to process all the data in the file.
5451

55-
You will need to keep reading from the file until it has been fully read. `feof` is your friend here to know
56-
whether there is any data left to read.
52+
You will need to keep reading from the file until it has been fully read. `feof` is your friend here and will inform you whether there is any data left to read.
5753

5854
Documentation on the `fopen` function can be found by pointing your browser here:
5955
[https://www.php.net/manual/en/function.fopen.php]()

0 commit comments

Comments
 (0)