-2

This is my array

$array = array(
        1 => 'A', 
        2 => 'B', 
        3 => 'C', 
        4 => 'D', 
        5 => 'E', 
    );

I want to Convert it like this

array('A','B','C','D','E');
0

3 Answers 3

0

use array_values function:

$array = array_values($array);

i hope it will be helpful.

Sign up to request clarification or add additional context in comments.

Comments

0

simply use array_values function:

$array = array_values($array);

Comments

0
$array = array_values($array);

Use array_values.

If you want to differentiate, then you can use:

$array1 = array_keys($array);
$array2 = array_values($array);

1 Comment

Man, All arrays have keys. See Here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.