note 93566 deleted from function.strpos by levim
| From: | levim@php.net | Date: | Tue, 22 Jul 2014 03:28:29 +0000 |
| Subject: | note 93566 deleted from function.strpos by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200013@lists.php.net to get a copy of this message | ||
Note Submitter: juniordez at gmail dot com
----
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);
}
?>