a result of the telnet/api with php

As with telnet/api and PHP to get the result of the command

/ip firewall filter {: foreach i in = [find] do = {: put ("bytes =". [get $ i bytes ]);}}

into a variable?

Telnet lib can not give results, and api can not execute commands like this. I ask for your help.

Send this API command and store the results in a variable.

/ip/firewall/filter/print =stats =.proplist=bytes

http://wiki.mikrotik.com/wiki/API_PHP_class

Work!