Simple reading RX TX via API PHP

Hello guys, could someone help me:

<?php

require('routeros_api.class.php');
$API = new RouterosAPI();
$API->debug = true;
if ($API->connect('192.168.88.1', 'admin', 'admin')) {

	$arrRXTX=$API->comm("/interface/monitor-traffic",
	array(
	".proplist"=> "rx-bits-per-second,tx-bits-per-second",
	"?interface" => "ether2",));

	print_r($arrRXTX);
		
			
   $API->disconnect();}   
?>

what is wrong on my code?
thanks

Get interface ID with /interface/print command and then call monitor using that ID “?interface=iface_name” will not work.
Also don’t know how your particular PHP api wrapper implements it, but for the monitor command you need to run a background listener, or run monitor with =once=

any chance to help me with this code???

at last I did it with Delphi! thanks to all!

Here is the solution that worked for me:

$param = ["interface"=>"ether1","once"=>"yes"];
$API->comm("/interface/monitor-traffic", $param);