totothegreat
totothegreat

Reputation: 1643

How can I convert an associative array to a regular one

I have an array like this:

3113 => ['id']=> stuff
        ['dad']=> gone

I want to convert it to this:

0 => ['id']=> stuff
     ['dad']=> gone

Without doing something like this:

$surveyPages = array();

foreach($arrangedPages as $arrangedPage){
    $surveyPages[] = $arrangedPage;
}

Is there a built-in function to do this?

Upvotes: 0

Views: 54

Answers (1)

sybear
sybear

Reputation: 7784

Yes, it is possible:

$surveyPages = array_values($arrangedPages);

Upvotes: 5

Related Questions