PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
what the problem is is currently that whole thing just prints out the post entries that you type in, what i need it to do is maybe store every sent post in an array, untill i press another key say "finish" and only then does it send it into the printer to finally print out everything i entered, in the specific collumns and rows ofcourse.
im stuck at that point and i have no idea on how to do it also need it in a hurry, so any help would be appretiated.
<?php
class Foo {
private $items;
function __construct() {
// initialize an empty array to store the items
$this->items = array();
}
function addItem($item) {
// append the item to the items array
$this->items[] = $item;
}
function sendAndCleanUp() {
foreach($this->items as $item) {
// do something with $item
}
// clean up the items
$this->items = array();
}
}
?>
how do i iterate with foreach over the output and where, i tryed doing it in the midst of my HTML it threw me an error, if i do it in the midst of a function then how will it send out the chunks of data?!