array([details] => Array([0] => Array( [name] => 454 [location] => 4) [2] => Array([name] => 454 [location] => 5)))

I have array details with two sub arrays [0] and [2]

how to convert and order [2] to [1]
array([details] => Array([0] => Array( [name] => 454 [location] => 4) [1] => Array([name] => 454 [location] => 5)))

any body help me

Recommended Answers

$details = array_values($details);
Jump to Post

All 2 Replies

Member Avatar
$details = array_values($details);

Excellent you saved my lot of time
very thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.