i've been having trouble with this project i'm doing. in short...I"M STUCK!!
I want to display the output of something I 'grep'ed, but the output came out wrong..
here's the code:
Code: Select all
<?
$totalgrep=3; //amount of processed to be 'grep'ed
$grepdata = array();
$pdetail = array();
##########HERE IS PROCESS NAME AND ITS COMMAND################
$grepdataї1]="e;iman_aig"e;;
$grepdataї2]="e;iman_emi"e;;
$grepdataї3]="e;iman_smpp"e;;
###############################################################
for($i=1;$i<=$totalgrep;$i++)
{ $pdetailї$i] = popen("e;ps -ef|grep "e;."e;'"e;.$grepdataї$i]."e;'"e;."e; |grep -v grep"e;, "e;r"e;);
}
?>Code: Select all
<?
for ($j=1;$j<=$totalgrep;$j++)
{
echo $pdetailї$j];
echo "e;<br />"e;;
}
if($pdetail==NULL)
{
echo "e;No Process Running!"e;;
exit;
}
?>Code: Select all
Resource id #2thanx!!