показывает "- Debug: Undefined variable: wordscut on line 168 of /wp-content/theme
"
function cutstr($string, $length) {
$string =strip_tags($string);
preg_match_all("/[x01-x7f]|[xc2-xdf][x80-xbf]|xe0[xa0-xbf][x80-xbf]|
[xe1-xef][x80-xbf][x80-xbf]|xf0[x90-xbf][x80-xbf][x80-xbf]|[xf1-xf7][x80-xbf][x80-xbf][x80-xbf]/", $string, $info);
for($i=0; $i<count($info[0]); $i++) {
$wordscut.= $info[0][$i];
$j= ord($info[0][$i]) > 127 ? $j + 2 : $j + 1;
if ($j > $length - 3) {
return $wordscut." ...";
}
}
return join('', $info[0]);
}
выше, моя функция. я знаю в php, это правильно, если переменная не объявлена до того, как она будет использована. почему она показывает "Undefined variable: wordscut, j
..... спасибо.
2, * ТРЕБУЕТСЯ: Non-printable characters were found in the '''functions.php'
'' файл. Вы можете проверить этот файл на наличие ошибок.
что такое Non-printable characters
. Как это исправить? спасибо.