note 82650 added to function.strripos
| From: | peev | Date: | Sun, 20 Apr 2008 21:14:26 +0000 |
| Subject: | note 82650 added to function.strripos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138586@lists.php.net to get a copy of this message | ||
OK, I guess this will be the final function implementation for PHP 4.x versions ( my previous posts
are invalid )
<?php
if(!function_exists("stripos")){
function stripos( $str, $needle, $offset = 0 ){
return strpos( strtolower( $str ), strtolower( $needle ), $offset );
}/* endfunction stripos */
}/* endfunction exists stripos */
if(!function_exists("strripos")){
function strripos( $haystack, $needle, $offset = 0 ) {
if( !is_string( $needle ) )$needle = chr( intval( $needle ) );
if( $offset < 0 ){
$temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );
}
else{
$temp_cut = strrev( substr( $haystack, 0, max( ( strlen($haystack) - $offset ), 0 ) )
);
}
if( ( $found = stripos( $temp_cut, strrev($needle) ) ) === FALSE )return FALSE;
$pos = ( strlen( $haystack ) - ( $found + $offset + strlen( $needle ) ) );
return $pos;
}/* endfunction strripos */
}/* endfunction exists strripos */
?>
----
Server IP: 69.147.83.197
Probable Submitter: 87.120.68.77
----
Manual Page -- http://www.php.net/manual/en/function.strripos.php
Edit -- https://master.php.net/note/edit/82650
Del: integrated -- https://master.php.net/note/delete/82650/integrated
Del: useless -- https://master.php.net/note/delete/82650/useless
Del: bad code -- https://master.php.net/note/delete/82650/bad+code
Del: spam -- https://master.php.net/note/delete/82650/spam
Del: non-english -- https://master.php.net/note/delete/82650/non-english
Del: in docs -- https://master.php.net/note/delete/82650/in+docs
Del: other reasons-- https://master.php.net/note/delete/82650
Reject -- https://master.php.net/note/reject/82650
Search -- https://master.php.net/manage/user-notes.php