I am retrieving an array of book objects with attributes like title,isbn and image. When I wish to display only labels using for loop it is displaying all entries. But when I try to display image, it only displays one. Also when I try to display both title and image, it says can
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/BookStore/BooksResult.php:14) in /Applications/XAMPP/xamppfiles/htdocs/BookStore/BooksResult.php on line 15
.
Below is the code.
foreach($booksArr as &$book)
{
$content = $book->Image;
$title=$book->s_Title;
echo $title;
header('Content-type: image/jpg');
{
echo $content;
}
}