₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,186 members, 8,420,713 topics. Date: Friday, 05 June 2026 at 09:50 AM

Toggle theme

Kwestc's Posts

Nairaland ForumKwestc's ProfileKwestc's Posts

1 (of 1 pages)

ProgrammingRe: Array Of Countries And Cities In Php by Kwestc: 11:47pm On Nov 25, 2012
I think this should help

<?php

$state = "Abuja,Anambra,Enugu,Akwa Ibom,Adamawa,Abia,Bauchi,Bayelsa,Benue,Borno,Cross River,Delta,Ebonyi,Edo,Ekiti,Gombe,Imo,Jigawa,Kaduna,Kano,Katsina,Kebbi,Kogi,Kwara,Lagos,Nasarawa,Niger,Ogun,Ondo,Osun,Oyo,Plateau,Rivers,Sokoto,Taraba,Yobe,Zamfara"


$city = "Aba,Abakaliki,Abeokuta,Abuja,Akure,Asaba,Anambra,Atlanta,Awka,Bauchi,Benin City,Birnin Kebbi,Calabar,Dutse,Eket,Enugu,Gombe,Gusau,Ibadan,Ife,Ikeja,Ikot-Abasi,Ikot Ekpene,Ikoyi,Ilorin,Jalingo,Jimeta,Jos,Kaduna,Kano,Katsina,Karu,Kumariya,Lafia,Lagos,Lokoja,Maiduguri,Makurdi,Minna,Nsukka,Ogbomoso,Onitsha,Oron,Oshogbo,Owerri,Owo,Oyo,Port Harcourt,Potiskum,Sokoto,Suleja,Umuahia,Uyo,Warri,Wukari,Yenagoa,Yola,Zaria";


/*
Function to format an array into a <select> tag

@param: $arr - The array to be converted.
@param: $field - The attribute name of the <select> tag

Usage: <form>
...
...
FormatSelect( $state, "State" );
...
FormatSelect( $city, "City" );
...
</form>

Prototype: String FormatSelect( Array $arr, String $field )
*/

function FormatSelect( $arr, $field ) {

$options = explode( ",", $arr );

$selectTag = '<select name="' .$field. '">';

foreach( $options as $key => $option ) {

$selectTag .= '<option value="'.$option.'">'. $option .'</option>' . "\n";
}

$selectTag .= '</select>';

return $selectTag;

}

?>
ProgrammingRe: [C++ Open Source] Relax! ( File Management Tool) by Kwestc: 10:31pm On Nov 25, 2012
I have tried your program, I think it is interesting. But you can make it more interesting by:

1. Adding a listener to any registered folder.
2. Let the program run as a system service.
3. Try reduce the overall program size (7.523 MB) is much for this current feature. Eliminate any dll that is not useful for now (If using other language is not an option).

Thanks, keep making Nigeria proud.

Seun (where is omotodun? I 've really miss him).
ProgrammingRe: Community Project(strictly Java) by Kwestc: 3:08pm On Jan 12, 2012
Coming in as a tester
That will do for intermediate programmer
But I hope it sees the light of the day

1 (of 1 pages)