Concept
How can you define arrays of strings in PHP?
ComputerScienceOne / 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.\n\n$names = array(\n\n\"Margaret Hamilton\",\n\n\"Ada Lovelace\",\n\n\"Grace Hopper\",\n\n\"Marie Curie\",\n\n\"Hedy Lamarr\"\n\n);"
Related Ideas
- How can you create and use arrays of strings in PHP?ComputerScienceOne · Comparisons
- How do you create and index arrays in PHP?ComputerScienceOne · Creating Arrays
- How can you create an array of strings in C?ComputerScienceOne · Arrays of Strings
- How are arrays of strings used in Java?ComputerScienceOne · Arrays of Strings
- How can you create arrays and collections of strings in Java?ComputerScienceOne · Comparisons
- How can you iterate over indexed and associative arrays in PHP?ComputerScienceOne · Iteration
- How can you count the elements in a PHP array?ComputerScienceOne · Useful Functions
- How does PHP support and create multidimensional arrays?ComputerScienceOne · Multidimensional Arrays