Bifalgorithm post · Computer science one · Comparisons

How can you create and use arrays of strings in PHP?

How can you create and use arrays of strings in PHP? (Computer science one · Comparisons) — "43.3. Arrays of Strings We often need to deal with collections of…

Ideas in this flowchart

  • Los arrays de strings permiten trabajar con colecciones de cadenas en PHP.
  • PHP permite definir arrays cuyos elementos son strings.
  • Los argumentos de la línea de comandos se almacenan en el array de strings $argv.
  • Cada string de un array se puede acceder mediante un índice.
  • $argv[0] contiene siempre el nombre del script.
  • También se pueden crear arrays propios de strings usando la misma sintaxis que para otros arrays.
  • El array $names contiene nombres como Margaret Hamilton, Ada Lovelace y Grace Hopper.
  • La misma declaración incluye también a Marie Curie y Hedy Lamarr.
Feed/

How can you create and use arrays of strings in PHP?

No cover

Channel

Computer science one

1 page

"43.3. Arrays of Strings We often need to deal with collections of strings. In PHP we can define arrays of strings. Indeed, we’ve seen arrays of strings before. When processing command line arguments, PHP defines an array of strings, $argv . Each string can be accessed using an index, $argv[0] for example is always the name of the script. We can create our own arrays of strings using the same syntax as with other arrays. 1 $names = array( 2 \"Margaret Hamilton\", 3 \"Ada Lovelace\", 4 \"Grace Hopper\", 5 \"Marie Curie\", 6 \"Hedy Lamarr\");"

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.