PHP References related issues

Source: Internet
Author: User
PHP Reference issues
I reference the function cut () of B file in a file, write include_once ("b.php") on page A, and then call But I don't know why I always run an error fatal Error:call to undefined function cut () in D:\XAMPP1.7.3\xampp\htdocs\web\index.php on line 233
Does this mean that there is no cut function defined? But I clearly defined it. Then look at the page a source file, the part that should show the result is my cut function code.
The Cut function is function Cut ($STR, $Length) {//$STR to intercept the string, $Length the length to intercept

Global $s;
$i = 0;
$l = 0;
$ll = strlen ($STR);
$s = $Str;
$f = true;

while ($i <= $ll) {
if (Ord ($Str {$i}) < 0x80) {
$l + +; $i + +;
} else if (Ord ($Str {$i}) < 0xe0) {
$l + +; $i + = 2;
} else if (Ord ($Str {$i}) < 0xf0) {
$l + = 2; $i + = 3;
} else if (Ord ($Str {$i}) < 0xf8) {
$l + = 1; $i + = 4;
} else if (Ord ($Str {$i}) < 0XFC) {
$l + = 1; $i + = 5;
} else if (Ord ($Str {$i}) < 0xFE) {
$l + = 1; $i + = 6;
}

if (($l >= $Length-1) && $f) {
$s = substr ($Str, 0, $i);
$f = false;
}

if (($l > $Length) && ($i < $ll)) {
$s = $s. '...'; Break If intercepted, the end of the string is appended with the ellipsis "..."
}
}
return $s;
}
?>

I do not know that I express clearly no, I hope someone can help answer.

------Solution--------------------
Have you opened the PHP break tag, your a file's PHP tag should be ------Solution--------------------
discuss

Have you opened the PHP break tag, your a file's PHP tag should be
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.