Help With API commands

I Have this scripts and works well to give me the name of the pppoe clientes disconnected, i want convert this for api, for me populate an xml.

:foreach clientes in=[/interface find where running=no && type=pppoe-in] do={:set $disconn value=([/interface get $clientes name].

In API i put $API->write(“/interface/print”,false);
$API->write(‘=type=’.$pppoein,false);
$API->write(‘=running=’.$running,true);
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);

$num =count($ARRAY);
for($i=0; $i<$num; $i++){
$no=$i+1;
echo “”.$ARRAY[$i][‘name’].“
”;
She’s me returned an unknown parameter (in debug api), where are my mistake?