我有以下字符串由system("last")
.
user1 ftpd11967 89-23-224-162.d Fri Aug 3 01:42 still logged in
怎么用str_replace
才能代替...
still logged in
和...
<span style='color:green'>still logged in</span>
试过了
system("last", $rawOutput);
$output = str_replace ( "still logged in" , "<span style='color:green'>still logged in</span>" ,$rawOutput );
echo $output;
除了系统之外,我也尝试过:
$rawOutput = shell_exec("last");
$output = str_replace( "still logged in" , "<span style='color:green'>still logged in</span>" ,$rawOutput );
echo $output;