如何在 PHP 二维多维数组上移动 X 和 Y 轴?
假设我有一个像这样的多维数组:
$data[0]['country'] = Angola
$data[0]['report'] = Food safety
$data[1]['country'] = Angola
$data[1]['report'] = Police
$data[2]['country'] = Zimbabwe
$data[2]['report'] = Water
$data[3]['country'] = Angola
$data[3]['report'] = Safety
$data[4]['country'] = Tanzania
$data[4]['report'] = Etc...
什么是最容易移动轴的,这样我就可以
$data['country'][0] = Angola
$data['country'][1] = Angola
$data['country'][2] = Zimbabwe
$data['country'][3] = Angola
$data['country'][4] = Tanzania
$data['report'][0] = Food safety
$data['report'][1] = Police
$data['report'][2] = Water
$data['report'][3] = Safety
$data['report'][4] = Etc...
say I have a multidimensional array like this:
$data[0]['country'] = Angola
$data[0]['report'] = Food safety
$data[1]['country'] = Angola
$data[1]['report'] = Police
$data[2]['country'] = Zimbabwe
$data[2]['report'] = Water
$data[3]['country'] = Angola
$data[3]['report'] = Safety
$data[4]['country'] = Tanzania
$data[4]['report'] = Etc...
What is the easiest to shift the axes, so that I would have
$data['country'][0] = Angola
$data['country'][1] = Angola
$data['country'][2] = Zimbabwe
$data['country'][3] = Angola
$data['country'][4] = Tanzania
$data['report'][0] = Food safety
$data['report'][1] = Police
$data['report'][2] = Water
$data['report'][3] = Safety
$data['report'][4] = Etc...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)