note 115013 added to function.strrpos

From: Date: Mon, 12 May 2014 18:57:50 +0000
Subject: note 115013 added to function.strrpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-199522@lists.php.net to get a copy of this message
I created an easy function that search a substring inside a string. It reverse the string and the substring inside an strpos and substract the result to the length of the string. if (!function_exists("real_strrpos")) { function real_strrpos($haystack,$needle) { $pos = strlen($haystack); $pos -= strpos(strrev($haystack), strrev($needle) ); $pos -= strlen($needle); return $pos; } } ---- Server IP: 72.52.91.14 Probable Submitter: 209.169.131.120 ---- Manual Page -- http://php.net/manual/en/function.strrpos.php Edit -- https://master.php.net/note/edit/115013 Del: integrated -- https://master.php.net/note/delete/115013/integrated Del: useless -- https://master.php.net/note/delete/115013/useless Del: bad code -- https://master.php.net/note/delete/115013/bad+code Del: spam -- https://master.php.net/note/delete/115013/spam Del: non-english -- https://master.php.net/note/delete/115013/non-english Del: in docs -- https://master.php.net/note/delete/115013/in+docs Del: other reasons-- https://master.php.net/note/delete/115013 Reject -- https://master.php.net/note/reject/115013 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#199522) next »