NewStats: 3,264,149 , 8,182,767 topics. Date: Monday, 09 June 2025 at 09:05 PM 3ky6j

6z3e3g

Kwestc's Posts w1y71

Kwestc's Posts

(1) (of 1 pages)

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;

}

?>
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 ed 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).
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)

(Go Up)

Sections: How To . 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland.