Created
July 7, 2012 08:49
-
-
Save honbin/3065535 to your computer and use it in GitHub Desktop.
担当エリアの担当者名を出力するサンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$area = "setagaya"; | |
$area_list = array( | |
1 => "setagaya", | |
2 => "sinagawa" | |
); | |
$staff_list = array( | |
1 => "honda", | |
2 => "tanaka", | |
3 => "yamada"); | |
$area_staff_list = array( | |
array("area_id" => 1, "staff_id" => array(1, 2)), | |
array("area_id" => 2, "staff_id" => array(1, 2)) | |
); | |
$area_id = array_search($area, $area_list); | |
foreach($area_staff_list as $v) { | |
if($v["area_id"] === $area_id) { | |
foreach($v["staff_id"] as $vv) { | |
echo $staff_list[$vv] . "\n"; | |
} | |
} | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment