includes/functions.php
changeset 606 daf8c556ada7
parent 599 52bffa6c499f
child 610 de33b0d26741
equal deleted inserted replaced
605:d2d4e40ecd29 606:daf8c556ada7
   575     }
   575     }
   576     $arr = arrayItemDown($arr, $keylist[$idx]);
   576     $arr = arrayItemDown($arr, $keylist[$idx]);
   577     $idx++;
   577     $idx++;
   578   }
   578   }
   579   return $arr;
   579   return $arr;
       
   580 }
       
   581 
       
   582 /**
       
   583  * Implementation of array_merge() that preserves key names. $arr2 takes precedence over $arr1.
       
   584  * @param array $arr1
       
   585  * @param array $arr2
       
   586  * @return array
       
   587  */
       
   588 
       
   589 function enano_safe_array_merge($arr1, $arr2)
       
   590 {
       
   591   $arr3 = $arr1;
       
   592   foreach($arr2 as $k => $v)
       
   593   {
       
   594     $arr3[$k] = $v;
       
   595   }
       
   596   return $arr3;
   580 }
   597 }
   581 
   598 
   582 // Convert IP address to hex string
   599 // Convert IP address to hex string
   583 // Input:  127.0.0.1  (string)
   600 // Input:  127.0.0.1  (string)
   584 // Output: 0x7f000001 (string)
   601 // Output: 0x7f000001 (string)