note 93566 added to function.strpos
| From: | juniordez at gmail dot com | Date: | Wed, 16 Sep 2009 16:47:16 +0000 |
| Subject: | note 93566 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160749@lists.php.net to get a copy of this message | ||
Function to get the string pos ($search), before the position ($pos) passed as parameter.
<?php
function strposReverse( $str, $search, $pos ){
$str = strrev($str);
$search = strrev($search);
$pos = (strlen($str) - 1) - $pos;
$posRev = strpos( $str, $search, $pos );
return (strlen($str) - 1) - $posRev - (strlen($search) - 1);
}
?>
----
Server IP: 187.16.23.128
Probable Submitter: 200.180.144.154
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/93566
Del: integrated -- https://master.php.net/note/delete/93566/integrated
Del: useless -- https://master.php.net/note/delete/93566/useless
Del: bad code -- https://master.php.net/note/delete/93566/bad+code
Del: spam -- https://master.php.net/note/delete/93566/spam
Del: non-english -- https://master.php.net/note/delete/93566/non-english
Del: in docs -- https://master.php.net/note/delete/93566/in+docs
Del: other reasons-- https://master.php.net/note/delete/93566
Reject -- https://master.php.net/note/reject/93566
Search -- https://master.php.net/manage/user-notes.php