note 104016 added to function.explode

From: Date: Tue, 17 May 2011 15:05:33 +0000
Subject: note 104016 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-179815@lists.php.net to get a copy of this message
Here's another one of those functions that allow you to work with an escaped delimiter. It works by internally url-encoding the escaped delimiters before calling explode(). So if your delimiter is a %, you should use another encoding function ;) <?php function explode_escaped( $delimiter, $string ) { $string = str_replace( '\\' . $delimiter, urlencode( $delimiter ), $string ); return array_map( 'urldecode', explode( $delimiter, $string ) ); } ?> ---- Server IP: 91.199.167.223 Probable Submitter: 82.93.68.91 ---- Manual Page -- http://www.php.net/manual/en/function.explode.php Edit -- https://master.php.net/note/edit/104016 Del: integrated -- https://master.php.net/note/delete/104016/integrated Del: useless -- https://master.php.net/note/delete/104016/useless Del: bad code -- https://master.php.net/note/delete/104016/bad+code Del: spam -- https://master.php.net/note/delete/104016/spam Del: non-english -- https://master.php.net/note/delete/104016/non-english Del: in docs -- https://master.php.net/note/delete/104016/in+docs Del: other reasons-- https://master.php.net/note/delete/104016 Reject -- https://master.php.net/note/reject/104016 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179815) next »