Hi,
I'm receiving an XML via php://input and after using simpleXML to break the elements down into variables and then what I want to do is append an array, or create an array of the variables every 30 seconds or so.
The reason is this script will be getting regular inputs, and rather than doing loads of mySQL updates or inserts, I assume it might be better for efficiency.
So, a couple of questions if anyone has a moment.
1) is there a way to check for a new input on php://input. 2) is there a better way to do this repeat check than sleep function? 3) how do I append/add to an array with these updating variables?
I haven't gone too far yet, so the code isn't useful but if you can forgive me simpleness:-
function input() {
$xml = new SimpleXMLElement($input);
$session_id = $xml->session_id;
$ip = $xml->ip;
$browser = $xml->browser;
store($session_id, $ip, $browser);
}
function store() {
$session_id = array();
$ip = array();
$browser = array();
}