0
Array
(
[Roofing] => Array
(
[0] => Roofing Contractors
[1] => Commercial Roofing
[2] => Contractor Metal Roofing
)
關聯數組的值搜索多維數組的關鍵我怎樣才能獲得「屋頂」的「屋頂承包商」值由PHP按該鍵
Array
(
[Roofing] => Array
(
[0] => Roofing Contractors
[1] => Commercial Roofing
[2] => Contractor Metal Roofing
)
關聯數組的值搜索多維數組的關鍵我怎樣才能獲得「屋頂」的「屋頂承包商」值由PHP按該鍵
$search = 'Roofing';
foreach($array as $item) {
if (strpos($item, $search) !== 0) {
// entry found
}
}
seacrhing algorith但有可能是一個更快的方式與pregmatch