• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP Array Help

jEnus

Senior member
I need assistance in creating a new array from the following array:

Array (
[Diesel] => Diesel
[691.400000572205] => 691.400000572205
[Off-Road Diesel] => Off-Road Diesel
[1104.20000505447] => 1104.20000505447 )

I need to new array to look like this:
Array (
[Diesel] => 691.400000572205
[Off-Road Diesel] => 1104.20000505447 )

What's the best way to go about this? This is how I will be receiving the object (using CakePHP, so I can't alter the structure of how I get it).

Thanks!
 
I'm not familiar with Cake but, are you receiving the input with a query or something? (that seems like mysql_assoc gone wrong)
 
Back
Top