Code examples for the Array tag - developer knowledge base (38)

Learn how to use Arrays in Ruby on Rails with code examples to help you get started.
Transform a Laravel collection into an array with examples: learn how to use the toArray() helper & other methods to manipulate your data.
"Learn how to check if an array is empty in Laravel with an example. See how you can quickly validate data before using it!"
"Learn how to convert an array to a string in Swift, with an example of a simple array of strings to illustrate the process."
Learn how to turn a string into an array in Python with an example. From splitting strings to creating lists & tuples, explore the different ways to make arrays from strings.
Learn to shuffle the elements of a two -dimensional array into one -dimensional using the Flatten method from the Numpy: arr = np.array ([1,2], [3.4]]); Arr.Flatten () → Array ([1, 2, 3, 4]).
"Learn how to create a Python set from an array using a simple example!"
Learn how to shift elements in a Python array w/ an example: move the first element to the end & vice versa.
Learn how to make a copy of an array in Python with an example, from shallow to deep copying.
Learn how to make a copy of a Python array, with example code showing how to use slicing and the copy module.
Create a 2D array in Python with an example: Learn how to create a 2D array in Python and how to use it in your programs.
Learn how to create an array in Python with an example, plus learn some of the most common array operations.
Create a 2D array in Python with code example: Learn how to declare, initialize, and access elements of a two-dimensional array in Python.
Learn how to convert an array to a string in Python with an example. Easily turn list elements into a comma-separated string.
Learn how to create multi-dimensional arrays in PHP with an example. Understand the basics and gain the confidence to use them in your code.
Create a multi-dimensional array in PHP w/ an example: learn how to store data in multiple layers & access it using loops & array functions.
PHP: Make an array global with example; learn how to make your variables accessible from anywhere in your script.
Learn how to make an array unique in PHP with an example: use array_unique() to remove duplicate values from an array.
PHP: Learn how to create a multidimensional array with an example. Create, access & modify nested arrays & get more out of your code!
Learn how to sort an array in PHP with a simple example. Understand how to use sort() & usort() to organize & rearrange your data.
1 2 Next