S
S
Shane Matte2016-08-06 21:34:24
Laravel
Shane Matte, 2016-08-06 21:34:24

How to remove a key in an array?

Hi. How to get an array of type
[23, 43, 543, 54]
from the database, laravel
[0 => 24, 1 => 43, 2 => 321]
gives

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Silm, 2016-08-07
@Silm

What kind of array is [23, 43, 543, 54] ?
In PHP, an entry like $arr = [23, 43, 543, 54];
this Creates an array like this: [0 => 23, 1 => 43, 2 => 543, 3 => 54]
There are no "arrays like [23, 43, 543, 54]" in PHP, it's just syntax, how can we create an array by hand, where each value will be assigned an ordinal index starting from zero.
2 questions for you:
1. What for you "arrays like [23, 43, 543, 54]"? What do you want to do with it?
2. What do you dislike about what Laravel outputs?

N
Nazar Mokrinsky, 2016-08-07
@nazarpc

https://secure.php.net/manual/en/function.array-va...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question