Tableau des régions et départements français

23 Sept 2010  

 Tableau des régions et départements français

Ce code est utile pour ceux qui ont besoin des régions et des départements associés (perso je l'ai utilisé pour faire une carte dynamique en jQuery) mais ça peut toujours servir.
Alors vu que je me suis embêté à faire ça, je vous propose de ne pas perdre votre temps à le refaire.

Chaque régions dispose d'un code région (que je vous invite à modifier si vous en avez besoin) et chaque département dispose de son numéro associé (exemple : Gironde => code : 33)

Voilà
aroybase 23 Sept 2010
# Catégorie Compatibilité Nombre de vues Site Archive
   Tableaux PHP 4, PHP 5, PHP 7 27 007  

       Code Source PHP


 
 01    
 02    
 03    
 04    
 05    
 06    
 07    
 08    
 09    
 10    
 11    
 12    
 13    
 14    
 15    
 16    
 17    
 18    
 19    
 20    
 21    
 22    
 23    
 24    
 25    
 26    
 27    
 28    
 29    
 30    
 31    
 32    
 33    
 34    
 35    
 36    
 37    
 38    
 39    
 40    
 41    
 42    
 43    
 44    
 45    
 46    
 47    
 48    
 49    
 50    
 51    
 52    
 53    
 54    
 55    
 56    
 57    
 58    
 59    
 60    
 61    
 62    
 63    
 64    
 65    
 66    
 67    
 68    
 69    
 70    
 71    
 72    
 73    
 74    
 75    
 76    
 77    
 78    
 79    
 80    
 81    
 82    
 83    
 84    
 85    
 86    
 87    
 88    
 89    
 90    
 91    
 92    
 93    
 94    
 95    
 96    
 97    
 98    
 99    
 100    
 101    
 102    
 103    
 104    
 105    
 106    
 107    
 108    
 109    
 110    
 111    
 112    
 113    
 114    
 115    
 116    
 117    
 118    
 119    
 120    
 121    
 122    
 123    
 124    
 125    
 126    
 127    
 128    
 129    
 130    
 131    
 132    
 133    
 134    
 135    
 136    
 137    
 138    
 139    
 140    
 141    
 142    
 143    
 144    
 145    
 146    
 147    
 148    
 149    
 150    
 151    
 152    
 153    
 154    
 155    
 156    
 157    
 158    
 159    
 160    
 161    
 162    
 163    
 164    
 165    
 166    
 167    
 168    
 169    
 170    
 171    
 172    
 173    
 174    
 175    
 176    
 177    
 178    
 179    
 180    
 181    
 182    
 183    
 184    
 185    
 186    
 187    
 188    
 189    
 190    
 191    
 192    
 193    
 194    
 195    
 196    
 197    
 198    
 199    
 200    
 201    
 202    
 203    
 204    
 205    
 206    
 207    
 208    
 209    
 210    
 211    
 212    
 213    
 214    
 215    
 216    
 217    
 218    
 219    
 220    
 221    
 222    
 223    
 224    
 225    
 226    
 227    
 228    
 229    
 230    
 231    
 232    
 233    
 234    
 235    
 236    
 237    
 238    
 239    
 240    
 241    
 242    
 243    
 244    
 245    
 246    
 247    
 248    
 249    
 250    
 251    
 252    
 253    
 254    
 255    
 256    
 257    
 258    
 259    
 260    
 261    
 262    
 263    
 264    
 265    
 266    
 267    
 268    
 269    
 270    
 271    
 272    
 273    
 274    
 275    
 276    
 277    
 278    
 279    
 280    
 281    
 282    
 283    
 284    
 285    
 286    
 287    
 288    
 289    
 290    
 291    
 292    
 293    
 294    
 295    
 296    
 297    
 298    
 299    
 300    
 301    
 302    
 303    
 304    
 305    
 306    
 307    
 308    
 309    
 310    
 311    
 312    
 313    
 314    
 315    
 316    
 317    
 318    
 319    
 320    
 321    
 322    
 323    
 324    
 325    
 326    
 327    
 328    
 329    
 330    
 331    
 332    
 333    
 334    
 335    
 336    
 337    
 338    
 339    
 340    
 341    
 342    
 343    
 344    
 345    
 346    
 347    
 348    
 349    
 350    
 351    
 352    
 353    
 354    
 355    
 356    
 357    
 358    
 359    
 360    
 361    
 362    
 363    
 364    
 365    
 366    
 367    
 368    
 369    
 370    
 371    
 372    
 373    
 374    
 375    
 376    
 377    
 378    
 379    
 380    
 381    
 382    
 383    
 384    
 385    
 386    
 387    
 388    
 389    
 390    
 391    
 392    
 393    
 394    
 395    
 396    
 397    
 398    
 399    
 400    
 401    
 402    
 403    
 404    
 405    
 406    
 407    
 408    
 409    
 410    
 411    
 412    
 413    
 414    
 415    
 416    
 417    
 418    
 419    
 420    
 421    
 422    
 423    
 424    
 425    
 426    
 427    
 428    
 429    
 430    
 431    
 432    
 433    
 434    
 435    
 436    
 437    
 438    
 439    
 440    
 441    
 442    
 443    
 444    
 445    
 446    
 447    
 448    
 449    
 450    
 451    
 452    
 453    
 454    
 455    
 456    
 457    
 458    
 459    
 460    
 461    
 462    
 463    
 464    
 465    
 466    
 467    
 468    
 469    
 470    
 471    
 472    
 473    
 474    
 475    
 476    
 477    
 478    
 479    
 480    
 481    
 482    
 483    
 484    
 485    
 486    
 487    
 488    
 489    
 490    
 491    
 492    
 493    
 494    
 495    
 496    
 497    
 498    
 499    
 500    
 501    
 502    
 503    
 504    
 505    
 506    
 507    
 508    
 509    
 510    
 511    
 512    
 513    
 514    
 515    
 516    
 517    
 518    
 519    
 520    
 521    
 522    
 523    
 524    
 525    
 526    
 527    
 528    
 529    
 530    
 531    
 532    
 533    
 534    
 535    
 536    
 537    
 538    
 539    
 540    
 541    
 542    
 543    
 544    
 545    
 546    
 547    
 548    
 549    
 550    
 551    
                               
<?php
/**************************************************************************************/
/*
     Titre  : Tableau des régions et départements français                                                                
                                                                                                                          
     URL    :  
     http://phpsources.org/code/php/tableaux/605_tableau-des-regions-et-departements-francais
     Auteur         : aroybase                                                                                            
     Date edition   : 23 Sept 2010                                                                                        
*/
/**************************************************************************************/
//-----------------------------------------------------------------------
    // Tableau des régions avec leurs coordonnées
    // Parametrable et modifiable plus facilement
    $regionsDept=array(
        // A
        array(
            "nom"=>"alsace",
            "code"=>"alsace",
            "departements"=>array(
                array(
                    "nom"=>"bas rhin",
                    "code"=>"67"
                ),
                array(
                    "nom"=>"haut rhin",
                    "code"=>"68"
                )
            )
        ),
        array(
            "nom"=>"aquitaine",
            "code"=>"aquitaine",
            "departements"=>array(
                array(
                    "nom"=>"dordogne",
                    "code"=>"24"
                ),
                array(
                    "nom"=>"gironde",
                    "code"=>"33"
                ),
                array(
                    "nom"=>"landes",
                    "code"=>"40"
                ),
                array(
                    "nom"=>"lot et garonne",
                    "code"=>"47"
                ),
                array(
                    "nom"=>"pyrénées atlantiques",
                    "code"=>"64"
                )
            )
        ),
        array(
            "nom"=>"auvergne",
            "code"=>"auvergne",
            "departements"=>array(
                array(
                    "nom"=>"allier",
                    "code"=>"3"
                ),
                array(
                    "nom"=>"cantal",
                    "code"=>"15"
                ),
                array(
                    "nom"=>"haute-loire",
                    "code"=>"43"
                ),
                array(
                    "nom"=>"puy de dome",
                    "code"=>"63"
                )
            )
        ),
        // B
        array(
            "nom"=>"basse normandie",
            "code"=>"basse_normandie",
            "departements"=>array(
                array(
                    "nom"=>"calvados",
                    "code"=>"15"
                ),
                array(
                    "nom"=>"manche",
                    "code"=>"50"
                ),
                array(
                    "nom"=>"orne",
                    "code"=>"61"
                )
            )
        ),
        array(
            "nom"=>"bourgogne",
            "code"=>"bourgogne",
            "departements"=>array(
                array(
                    "nom"=>"Cote d'or",
                    "code"=>"23"
                ),
                array(
                    "nom"=>"nièvre",
                    "code"=>"58"
                ),
                array(
                    "nom"=>"saône et loire",
                    "code"=>"71"
                ),
                array(
                    "nom"=>"yonne",
                    "code"=>"89"
                )
            )
        ),
        array(
            "nom"=>"bretagne",
            "code"=>"bretagne",
            "departements"=>array(
                array(
                    "nom"=>"côte d'armor",
                    "code"=>"22"
                ),
                array(
                    "nom"=>"finistère",
                    "code"=>"29"
                ),
                array(
                    "nom"=>"ile et vilaine",
                    "code"=>"35"
                ),
                array(
                    "nom"=>"morbihan",
                    "code"=>"56"
                )
            )
        ),
        // C
        array(
            "nom"=>"centre",
            "code"=>"centre",
            "departements"=>array(
                array(
                    "nom"=>"cher",
                    "code"=>"18"
                ),
                array(
                    "nom"=>"eure et loire",
                    "code"=>"28"
                ),
                array(
                    "nom"=>"indre",
                    "code"=>"36"
                ),
                array(
                    "nom"=>"indre et loire",
                    "code"=>"37"
                ),
                array(
                    "nom"=>"loire et cher",
                    "code"=>"41"
                ),
                array(
                    "nom"=>"loiret",
                    "code"=>"45"
                )
            )
        ),
        array(
            "nom"=>"champagne ardenne",
            "code"=>"champagne_ardenne",
            "departements"=>array(
                array(
                    "nom"=>"ardennes",
                    "code"=>"8"
                ),
                array(
                    "nom"=>"aubre",
                    "code"=>"10"
                ),
                array(
                    "nom"=>"marne",
                    "code"=>"51"
                ),
                array(
                    "nom"=>"haute marne",
                    "code"=>"52"
                )
            )
        ),
        
// array("nom"=>"corse","coordonnees"=>"77,403,71,434,73,466,50,458,39,400,53,39
//2,74,381,68,388"),
        // F
        array(
            "nom"=>"franche comte",
            "code"=>"franche_comte",
            "departements"=>array(
                array(
                    "nom"=>"doubs",
                    "code"=>"25"
                ),
                array(
                    "nom"=>"jura",
                    "code"=>"39"
                ),
                array(
                    "nom"=>"haute saône",
                    "code"=>"70"
                ),
                array(
                    "nom"=>"territoire de bellefort",
                    "code"=>"90"
                )
            )
        ),
        // H
        array(
            "nom"=>"haute normandie",
            "code"=>"haute_normandie",
            "departements"=>array(
                array(
                    "nom"=>"calvados",
                    "code"=>"14"
                ),
                array(
                    "nom"=>"eure",
                    "code"=>"27"
                ),
                array(
                    "nom"=>"manche",
                    "code"=>"50"
                ),
                array(
                    "nom"=>"orne",
                    "code"=>"61"
                ),
                array(
                    "nom"=>"seine maritime",
                    "code"=>"76"
                )
            )
        ),
        // I
        array(
            "nom"=>"ile de france",
            "code"=>"ile_de_france",
            "departements"=>array(
                array(
                    "nom"=>"paris",
                    "code"=>"75"
                ),
                array(
                    "nom"=>"seine et marnes",
                    "code"=>"77"
                ),
                array(
                    "nom"=>"yvelines",
                    "code"=>"78"
                ),
                array(
                    "nom"=>"essonne",
                    "code"=>"91"
                ),
                array(
                    "nom"=>"haut de seine",
                    "code"=>"92"
                ),
                array(
                    "nom"=>"seine saint denis",
                    "code"=>"93"
                ),
                array(
                    "nom"=>"val de marne",
                    "code"=>"94"
                ),
                array(
                    "nom"=>"val d'oise",
                    "code"=>"95"
                )
            )
        ),
        // L
        array(
            "nom"=>"languedoc rousillon",
            "code"=>"languedoc_rousillon",
            "departements"=>array(
                array(
                    "nom"=>"aude",
                    "code"=>"11"
                ),
                array(
                    "nom"=>"gard",
                    "code"=>"30"
                ),
                array(
                    "nom"=>"hérault",
                    "code"=>"34"
                ),
                array(
                    "nom"=>"lozère",
                    "code"=>"48"
                ),
                array(
                    "nom"=>"pyrénées orientales",
                    "code"=>"66"
                )
            )
        ),
        array(
            "nom"=>"limousin",
            "code"=>"limousin",
            "departements"=>array(
                array(
                    "nom"=>"correz",
                    "code"=>"19"
                ),
                array(
                    "nom"=>"creuse",
                    "code"=>"23"
                ),
                array(
                    "nom"=>"haute vienne",
                    "code"=>"87"
                )
            )
        ),
        array(
            "nom"=>"lorraine",
            "code"=>"lorraine",
            "departements"=>array(
                array(
                    "nom"=>"meurthe et moselle",
                    "code"=>"54"
                ),
                array(
                    "nom"=>"meuse",
                    "code"=>"55"
                ),
                array(
                    "nom"=>"moselle",
                    "code"=>"57"
                ),
                array(
                    "nom"=>"vosges",
                    "code"=>"88"
                )
            )
        ),
        // M
        array(
            "nom"=>"midi pyrenees",
            "code"=>"midi_pyrenees",
            "departements"=>array(
                array(
                    "nom"=>"ariège",
                    "code"=>"9"
                ),
                array(
                    "nom"=>"aveyron",
                    "code"=>"12",
                    "coordonnees"=>"xxxxxxx"
                ),
                array(
                    "nom"=>"haute-garonne",
                    "code"=>"31"
                ),
                array(
                    "nom"=>"gers",
                    "code"=>"32"
                ),
                array(
                    "nom"=>"lot",
                    "code"=>"46"
                ),
                array(
                    "nom"=>"hautes pyrénées",
                    "code"=>"65"
                ),
                array(
                    "nom"=>"tarn",
                    "code"=>"81"
                ),
                array(
                    "nom"=>"tarn et garonne",
                    "code"=>"82"
                )
            )
        ),
        // N
        array(
            "nom"=>"nord pas de calais",
            "code"=>"nord_pas_de_calais",
            "departements"=>array(
                array(
                    "nom"=>"nord",
                    "code"=>"59"
                ),
                array(
                    "nom"=>"pas de calais",
                    "code"=>"62"
                )
            )
        ),
        // P
        array(
            "nom"=>"paca",
            "code"=>"paca",
            "departements"=>array(
                array(
                    "nom"=>"alpes de haute provence",
                    "code"=>"4"
                ),
                array(
                    "nom"=>"hautes alpes",
                    "code"=>"5"
                ),
                array(
                    "nom"=>"alpes maritimes",
                    "code"=>"6"
                ),
                array(
                    "nom"=>"bouches du rhône",
                    "code"=>"13"
                ),
                array(
                    "nom"=>"var",
                    "code"=>"83"
                ),
                array(
                    "nom"=>"vaucluse",
                    "code"=>"84"
                )
            )
        ),
        array(
            "nom"=>"pays de la loire",
            "code"=>"pays_de_la_loire",
            "departements"=>array(
                array(
                    "nom"=>"loire atlantique",
                    "code"=>"44"
                ),
                    array(
                    "nom"=>"maine et loire",
                    "code"=>"49"
                ),
                    array(
                    "nom"=>"mayenne",
                    "code"=>"53"
                ),
                    array(
                    "nom"=>"sarthe",
                    "code"=>"72"
                ),
                array(
                    "nom"=>"vendée",
                    "code"=>"85"
                )
            )
        ),
        array(
            "nom"=>"picardie",
            "code"=>"picardie",
            "departements"=>array(
                array(
                    "nom"=>"aisne",
                    "code"=>"02"
                ),
                    array(
                    "nom"=>"oise",
                    "code"=>"60"
                ),
                    array(
                    "nom"=>"somme",
                    "code"=>"80"
                )
            )
        ),
        array(
            "nom"=>"poitou charentes",
            "code"=>"poitou_charentes",
            "departements"=>array(
                array(
                    "nom"=>"charente",
                    "code"=>"16"
                ),
                array(
                    "nom"=>"charente maritime",
                    "code"=>"17"
                ),
                array(
                    "nom"=>"deux sèvres",
                    "code"=>"79"
                ),
                array(
                    "nom"=>"vienne",
                    "code"=>"86"
                )
            )
        ),
        // R
        array(
            "nom"=>"rhone alpes",
            "code"=>"rhone_alpes",
            "departements"=>array(
                array(
                    "nom"=>"ain",
                    "code"=>"01",
                ),
                array(
                    "nom"=>"ardèche",
                    "code"=>"07"
                ),
                array(
                    "nom"=>"drôme",
                    "code"=>"26"
                ),
                array(
                    "nom"=>"isère",
                    "code"=>"38"
                ),
                array(
                    "nom"=>"loire",
                    "code"=>"42"
                ),
                array(
                    "nom"=>"rhône",
                    "code"=>"69"
                ),
                array(
                    "nom"=>"savoie",
                    "code"=>"73"
                ),
                array(
                    "nom"=>"haute savoie",
                    "code"=>"74"
                )
            )
        )
    );
    
    // var_dump($regionsCoords);
//-----------------------------------------------------------------------
?>

...  Manuel PHP - Fonctions du code source

   php.net  Description Versions PHP OUTIL
   array Crée un tableau PHP 4, PHP 5, PHP 7


  • L'ajout de commentaire est libre et ne demande pas d'inscription,
  •   invité

nous vous encourageons à contribuer à l'utilisation de PHP en ajoutant vos remarques.