Voting

Please answer this simple SPAM challenge: one minus zero?
(Example: nine)

The Note You're Voting On

m
11 years ago
Regarding the code for the function beginsWith($str, $sub), I found that it has problems when only one character is present after the string searched for. I found that this works better instead:

<?php
function beginsWith($str, $sub) {
    return (
strncmp($str, $sub, strlen($sub)) == 0);
}
?>

<< Back to user notes page

To Top