I would like to see a single line with these elements.
$ArrayDocs = array (
0 => array ('titre' => 'aaa','ref' => 'aaa','date' => 'aaa','like' => aaa,'url' => 'aaa',),
1 => array ('titre' => 'aaa1','ref' => 'aaa1','date' => 'aaa1','like' => aaa1,'url' => 'aaa1',)
);
Example :
foreach($ArrayDocs AS $key => $doc)
{
echo $key.' '.$doc['titre'].' '.$doc['ref'].' ';
}
Transform : It does not work.
foreach($ArrayDocs[1] AS $key => $doc) // Example shows the line 1 of Table
{
echo $key.' '.$doc['titre'].' '.$doc['ref'].' ';
}
Since you explicitly set the index in the parent array container to index
1
inside yourforeach
loop.print_r
result:You don't need to have that index. So pointing into:
Just:
Sample Output