我有这篇文章并在孩子内部获取方法。
$array1 = [
"attribute" => "MySchool",
"child" =>
[
"method" => "GET",
"child" => [
"attribute" => "school",
"child" => [
[
"attribute" => "harvard"
],
],
],
],
[
"method" => "POST",
"child" => [
"attribute" => "school",
"child" => [
[
"attribute" => "stanford"
],
],
],
],
]
$array2 = array(
0 => "GET"
1 => "school"
2 => "harvard"
);
现在我只想要方法get和它的属性值。
所以我想要一个像这样的数组结果:
array(
0 => "MySchool"
1 => "get"
2 => "school"
3 => "harvard"
)
MMTTMM