ConFoo Montreal 2026: Call for Papers

Voting

: max(four, seven)?
(Example: nine)

The Note You're Voting On

carlos dot lage at gmail dot com
20 years ago
I used dchris1 at bigpond dot net dot au 's reverse strrchr and reduced it to one line of code and fixed it's functionality - the real strrchr() returns FALSE if the needle is not found, not the haystack :)

<?php
// reverse strrchr()
function reverse_strrchr($haystack, $needle)
{
return
strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) +1 ) : false;
}
?>

<< Back to user notes page

To Top