Possibly the array helpers are the solution.
$response = .... //The result of the query.
array_only(range(0,(sizeof($response)/2)-1). In this case you are obtaining only all the index from 0 to n/2 -1
Details here: http://laravel.com/docs/5.1/helpers#method-array-only
Hope it works.
Thanks, @JuanDMeGon.
Actually, I was looking to accomplish the opposite (weed out the integer-based keys), but I see that array_except would be the solution there. Using helper functions is a good idea that I'll look into.
But I was hoping to find a way to turn this "feature" off at the source in the Laravel/Lumen DB facade itself. I can't imagine why this would be on by default, so I'm wondering if I've set something up incorrectly.
Thanks, Steve
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community