Manager and PHP

Hi all

With a rather short experience in php, I have been trying to get a page that could show me who’s connected to my asterisk server. Here is what I got :

The problem is … the code is horrible …

Anyone used php with manager ?
My main concern is how the data is returned by the manager. Any way to get a nice array ?
thanks :smile:

You could create an array from the socket output in php.

It would go something like this example:

<?php $blah = array(); while (!feof($socket)) { $wrets = fread($socket, 8192); array_push($blah,$wrets); } ?>

You can also push classes onto an array, so you can can make an array of objects.