note 104489 added to function.str-split

From: Date: Fri, 17 Jun 2011 16:28:10 +0000
Subject: note 104489 added to function.str-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-180646@lists.php.net to get a copy of this message
self correction: cannot strrev() the array... have to temporarily rejoin it first... // $del should be a "safe" delimiter for the text function str_rsplit( $str, $len, $del ) { return explode( $del, strrev(implode( $del, str_split( strrev($str), $len )))); } usage: // a string that is highly unlikely to be in the text to split $REV = str_rsplit( $string, 4, "ogga-booga !^*&^#$@\n\r\n\n" ) ---- Server IP: 69.147.83.197 Probable Submitter: 67.0.3.235 ---- Manual Page -- http://www.php.net/manual/en/function.str-split.php Edit -- https://master.php.net/note/edit/104489 Del: integrated -- https://master.php.net/note/delete/104489/integrated Del: useless -- https://master.php.net/note/delete/104489/useless Del: bad code -- https://master.php.net/note/delete/104489/bad+code Del: spam -- https://master.php.net/note/delete/104489/spam Del: non-english -- https://master.php.net/note/delete/104489/non-english Del: in docs -- https://master.php.net/note/delete/104489/in+docs Del: other reasons-- https://master.php.net/note/delete/104489 Reject -- https://master.php.net/note/reject/104489 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180646) next »