PHP 8.4.24 Released!

Voting

: min(one, three)?
(Example: nine)

The Note You're Voting On

philip
21 years ago
Many people look for in_string which does not exist in PHP, so, here's the most efficient form of in_string() (that works in both PHP 4/5) that I can think of:
<?php
function in_string($needle, $haystack, $insensitive = false) {
    if ($insensitive) {
        return false !== stristr($haystack, $needle);
    } else {
        return false !== strpos($haystack, $needle);
    }
}
?>

<< Back to user notes page

To Top