PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php // $array = [112223, 88, 1233, 55,44]; // // Initialize an empty associative array // $result = []; // // Loop through the given array // for ($i = 0; $i < count($array) - 1; $i++) { // // Check if the current element is odd // if ($array[$i] % 2 !== 0) { // // Assign the next even value as the value for the current odd key // $result[$array[$i]] = $array[$i + 1]; // } // } // // Print the resulting associative array // print_r($result); print_r(array_keys([45543 => 88,34554387 => 100,11556687 => 400])); print_r(gettype([45543 => 88,34554387 => 100,11556687 => 400]);
Show:  
Copy Clear