Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/31-advanced-strings/120-startwith/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Моргулис')); // => 6
print_r(mb_strpos('Naïve Bayes', 'Bayes')); // => 6
```

The function returned `6` — the index of the letter `М`, where the substring begins. Indexes, as usual, are counted from zero:
The function returned `6` — the index of the letter `B`, where the substring begins. Indexes, as usual, are counted from zero:

Check notice on line 9 in modules/31-advanced-strings/120-startwith/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/31-advanced-strings/120-startwith/en/README.md#L9

File types are normally capitalized. (FILE_EXTENSIONS_CASE[1]) Suggestions: `PHP` URL: https://languagetool.org/insights/post/spelling-capital-letters/ Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1 Category: CASING
Raw output
modules/31-advanced-strings/120-startwith/en/README.md:9:126: File types are normally capitalized. (FILE_EXTENSIONS_CASE[1])
 Suggestions: `PHP`
 URL: https://languagetool.org/insights/post/spelling-capital-letters/ 
 Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1
 Category: CASING

```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Валар')); // => 0
print_r(mb_strpos('Naïve Bayes', 'Naïve')); // => 0
```

Here it returned `0`: the substring was found at the very beginning of the string.
Expand All @@ -21,7 +21,7 @@
```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Дракарис')); // =>
print_r(mb_strpos('Naïve Bayes', 'Fisher')); // =>
```

There's a hidden trap here that beginners often fall into: the result `0` ("found at the beginning of the string") is easy to confuse with `false` ("not found at all"). To tell them apart, you need a strict comparison — we'll cover it in the lessons about logic. For now, just remember: `mb_strpos()` answers the question "where?", not "is there?".
8 changes: 4 additions & 4 deletions modules/31-advanced-strings/120-startwith/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Моргулис')); // => 6
print_r(mb_strpos('Feliz cumpleaños', 'cumpleaños')); // => 6
```

La función devolvió `6`: el índice de la letra `М`, donde comienza la subcadena. Los índices, como de costumbre, se cuentan desde cero:
La función devolvió `6`: el índice de la letra `c`, donde comienza la subcadena. Los índices, como de costumbre, se cuentan desde cero:

Check notice on line 9 in modules/31-advanced-strings/120-startwith/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/31-advanced-strings/120-startwith/es/README.md#L9

Possible spelling mistake found. (EN_MULTITOKEN_SPELLING_TWO[2]) Suggestions: `Los Indios` Rule: https://community.languagetool.org/rule/show/EN_MULTITOKEN_SPELLING_TWO?lang=en-US&subId=2 Category: MULTITOKEN_SPELLING
Raw output
modules/31-advanced-strings/120-startwith/es/README.md:9:69: Possible spelling mistake found. (EN_MULTITOKEN_SPELLING_TWO[2])
 Suggestions: `Los Indios`
 Rule: https://community.languagetool.org/rule/show/EN_MULTITOKEN_SPELLING_TWO?lang=en-US&subId=2
 Category: MULTITOKEN_SPELLING

Check notice on line 9 in modules/31-advanced-strings/120-startwith/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/31-advanced-strings/120-startwith/es/README.md#L9

File types are normally capitalized. (FILE_EXTENSIONS_CASE[1]) Suggestions: `PHP` URL: https://languagetool.org/insights/post/spelling-capital-letters/ Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1 Category: CASING
Raw output
modules/31-advanced-strings/120-startwith/es/README.md:9:128: File types are normally capitalized. (FILE_EXTENSIONS_CASE[1])
 Suggestions: `PHP`
 URL: https://languagetool.org/insights/post/spelling-capital-letters/ 
 Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1
 Category: CASING

```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Валар')); // => 0
print_r(mb_strpos('Feliz cumpleaños', 'Feliz')); // => 0
```

Aquí se devolvió `0`: la subcadena se encontró justo al inicio de la cadena.
Expand All @@ -21,7 +21,7 @@
```php
<?php

print_r(mb_strpos('Валар Моргулис', 'Дракарис')); // =>
print_r(mb_strpos('Feliz cumpleaños', 'Navidad')); // =>
```

Aquí se esconde una trampa en la que suelen caer los principiantes: el resultado `0` («encontrado al inicio de la cadena») es fácil de confundir con `false` («no encontrado en absoluto»). Para distinguirlos, se necesita una comparación estricta, que veremos en las lecciones sobre lógica. Por ahora, recuerda: `mb_strpos()` responde a la pregunta «¿dónde?», no «¿existe?».
4 changes: 0 additions & 4 deletions modules/33-data-types/40-primitive-data-types/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,3 @@ PHP primitive types
Besides strings and numbers, PHP has the boolean type `bool` with the values `true` and `false`, as well as the special value `null`. We'll encounter them in more detail in the future.

There are also composite types: arrays, objects, and others. We'll get to know them later. Moreover, in PHP you can create your own types (for example, classes), but first it's important to get a good grasp of the primitives.

## Strings and lines

In English, strings in programming are called **strings**, while lines of text files are called **lines**. In Russian there can be confusion, so throughout the lessons we'll say "строка" for the "string" data type and "строчка" for lines in files.
4 changes: 0 additions & 4 deletions modules/33-data-types/40-primitive-data-types/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,3 @@ Tipos primitivos de PHP
Además de las cadenas y los números, PHP tiene el tipo booleano `bool` con los valores `true` y `false`, así como el valor especial `null`. Nos encontraremos con ellos con más detalle en el futuro.

También existen tipos compuestos: arrays, objetos y otros. Los conoceremos más adelante. Es más, en PHP se pueden crear tus propios tipos (por ejemplo, clases), pero primero es importante entender bien los primitivos.

## Strings y lines

En inglés, las cadenas de texto en programación se llaman **strings**, y las líneas de los archivos de texto se llaman **lines**. En ruso puede haber confusión, por eso en todas las lecciones diremos «строка» para referirnos al tipo de dato «cadena de texto», y «строчка» para las lines en los archivos.
Loading