0

My query returns this:

Array
(
    [0] => Array
        (
            [id] => 1
            [username] => admin
            [admin] => 1
        )

)

In this case the array contains one array, so I want to remove the outside array:

Array
        (
            [id] => 1
            [username] => admin
            [admin] => 1
        )

Can you guys help me?

0

1 Answer 1

3

Huh, just

$innerArray = $outsideArray[0];
Sign up to request clarification or add additional context in comments.

2 Comments

But how do count the arrays in the outside array?
if (count($outsideArray)==1){ $innerArray = $outsideArray[0];};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.