Skip to content
Advertisement

Tag: arraylist

php can not get array value from an array

I have an array: And I would like to get the first value in the array: I have tried each of the following: array_values($_array)[0]; $data[0]; array_keys($data)[0]; But none of them work, and I instead get an empty string. I need to get the first element or key of the array. Answer you can use array_key_first(your_array) Get the first key of

Merge multiple array in php laravel

Let us say I have a set of data of the first name first name : `{ “abc”,”bvd”,”jhhg”, “jju”,”jju”}` Last name : `{ “hhh”,”uuu”,”tre”, “vvg”,”yyy”}` Age : `{ “44”,”33″,”34″, “34,”65″}` I want the …

Advertisement