Skip to content
Advertisement

Laravel: How to separate array from query result into variables?

I have something like this:

JavaScript

How to separate the ‘column’ and ‘count’ into variables?

JavaScript

Advertisement

Answer

Use native PHP functions; array_keys and array_values.

JavaScript

For more details, read the below links;

https://www.php.net/manual/en/function.array-keys.php

https://www.php.net/manual/en/function.array-values.php

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement