'规则缓冲清除', 'Starting replication'=>'开始规则', 'Wait -> Brk'=>'镜像状态改变,由等待到停止状态', 'OK -> Wait'=>'镜像状态改变,由OK到等待状态',);$logs = sd_get_log_sys_by_uuid(uuid);for($i=0; $i<$count(logs); $i++) { if($lang_Log[$logs[$i]]){ echo $lang_Log[$logs[$i]]; }else{ foreach ($lang_Log as $k=> $v) { $pos = strpos($logs[$i], $k); if($pos !== false){ echo $v; break; } } }}?>
All I want to do is iterate over the array to find out if the array element exists with the current string, if it does not exist, output the current string, and if present, the output array's key value.
is the translation function.
1. Determine if the log has a corresponding Chinese in the array (because the log is dead).
2. Determine if the log part string has a corresponding Chinese (some logs are statements that contain variables, so you need to match them with some strings and then translate them).
3. Because the outer layer has a logs array of loop statements, so use break, do not exit.
Reply content:
'规则缓冲清除', 'Starting replication'=>'开始规则', 'Wait -> Brk'=>'镜像状态改变,由等待到停止状态', 'OK -> Wait'=>'镜像状态改变,由OK到等待状态',);$logs = sd_get_log_sys_by_uuid(uuid);for($i=0; $i<$count(logs); $i++) { if($lang_Log[$logs[$i]]){ echo $lang_Log[$logs[$i]]; }else{ foreach ($lang_Log as $k=> $v) { $pos = strpos($logs[$i], $k); if($pos !== false){ echo $v; break; } } }}?>
All I want to do is iterate over the array to find out if the array element exists with the current string, if it does not exist, output the current string, and if present, the output array's key value.
is the translation function.
1. Determine if the log has a corresponding Chinese in the array (because the log is dead).
2. Determine if the log part string has a corresponding Chinese (some logs are statements that contain variables, so you need to match them with some strings and then translate them).
3. Because the outer layer has a logs array of loop statements, so use break, do not exit.
Why don't you go else
?
You cycle through every word, the first of the loops is rep-cache during mirror is cleard
,
exists in $s
it?
不存在
Can't we go else
?
走
Shipping not running exit;
?
运行
And not continue to execute?
不继续
Do you check the following words?
不检查
foreach ($lang_Log as $k=> $v) { $pos = strpos($s, $k); if($pos !== false){ echo $v; break;
$s = "mirror return 0, Peer 94, Bytes recv [en/de] [2005667596/2005667596 = 100]";
foreach ($lang _log as $k = + $v) {
$pos = strpos($s, $k);if($pos !== false){ echo 'value = ' . $v . "
;}else{ echo 'key = ' . $k . "
;}
}