what does this syntax means in php
foreach ( $meta as $t => $data )
what does $t => $data mean in the above.
because foreach is basically (example from w3school)
<?php
$colors = array("red","green","blue","yellow");
foreach ($colors as $value)
{
echo "$value <br>";
}
?>
it the above case $value represents $t => $data
$colors
represents $meta
the array $meta is as follows
$meta = Array(
'facebook' => Array(
'title' => 'og:title',
'type' => 'og:type',
'url' => 'og:url',
'thumbnail' => 'og:image',
'width' => 'og:image:width',
'height' => 'og:image:height',
'sitename' => 'og:site_name',
'key' => 'fb:admins',
'description' => 'og:description'
),
'twitter' => Array(
'card' => 'twitter:card',
'description' => 'twitter:description',
)
);
then what is $t and what is $data
also if i want to get 'title' in 'facebook' as a seprate key how to do it. ie. will
$t => $data => $final work
$t = facebook or twitter
$data = title etc
$final = og:title etc
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…