php - Link two arrays and use them like MySQL DB -


im trying mate , shes sticking arrays no database use time :( countys page shows countys , when 1 clicked taken different page displaying walks county.

$countys = array(); $countys[101] = array(                 "name" => "armagh",                 "img" => "css/images/map.jpg",                 "largeimg" => "css/images/banmap.jpg"             );  $countys[102] = array(                 "name" => "antrim",                 "img" => "css/images/map.jpg",                 "largeimg" => "css/images/banmap.jpg"             );  $walks = array(); $walks[1] = array(     "name" => "portadown walk",     "county" => "armagh",     "img" => "css/images/map.jpg",     "location" => "portadown",      "largeimg" => "css/images/banmap.jpg" );  $walks[2] = array(     "name" => "antrim walk",     "county" => "antrim",     "img" => "css/images/map.jpg",     "location" => "causeway" ); 

would multidimensional array work ok or maybe for/while loop check if $walk['county'] equal county?

a multidimensional array best this, imho.

$countys[101] = array(     "name"     => "armagh",     "img"      => "css/images/map.jpg",     "largeimg" => "css/images/banmap.jpg",     "walks"    => array(         array(             "name"     => "portadown walk",             "img"      => "css/images/map.jpg",             "location" => "portadown",              "largeimg" => "css/images/banmap.jpg"         ),         array(             "name"     => "some other walk",             "img"      => "css/images/map.jpg",             "location" => "somewhere else",              "largeimg" => "css/images/banmap.jpg"         )     ) ); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -