Let's say that I want a webpage that displays PHP memory usage in realtime.
I can get memory usage with:
memory_get_peak_usage(1)
I can print it in an input field like this:
<form>
Memory usage: <input type="text" name="FirstName" value="<?echo memory_get_peak_usage(1);?>">
</form>
and an option to update the value in the input field would be reloading the page, but how can I do it without refreshing?
I bet I have to use GET/POST methods.
while (1)
{
$mem = memory_get_peak_usage(1);
sleep(0.5);
update_inputField_value($mem);
}