Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Arrange the data
- $db = Application_Model_Db::db_load();
- $sql = "select telephonecode, concat(countryname, '(',telephonecode,')' ) from sh_timezone";
- $result = $db->fetchPairs($sql);
- //$result = array_merge(array(''=>''), $result);
- $result = array_merge_recursive( array(''=>'') , $result);
- Zend_Debug::dump($result);
- Output:
- <pre>array(3) {
- [""] => string(0) ""
- [0] => string(11) "Belgium(32)"
- [1] => string(14) "Nederlands(31)"
- }
- </pre>
- Expecting as:
- <pre>array(3) {
- [""] => string(0) ""
- [32] => string(11) "Belgium(32)"
- [31] => string(14) "Nederlands(31)"
- }
- </pre>
Add Comment
Please, Sign In to add comment