我有一个数组,但键/索引只显示所有值的零而不是0,1,2,3,4,5。当我打印数组时,它显示为
Array
(
[0] => https://giphy.com/ladygaga
)
Array
(
[0] => https://plus.google.com/+LadyGaga
)
Array
(
[0] => https://twitter.com/ladygaga
)
Array
(
[0] => https://www.facebook.com/ladygaga
)
Array
(
[0] => https://www.instagram.com/ladygaga/
)
这是我的代码
foreach($social_media as $social){
$typesocial = $social['type'];
$val = array($social['url']['resource']);
if ($social['type'] === 'social network')
{
echo '<pre>'; print_r($val); echo '</pre>';
}
}