note 82859 added to function.explode

From: Date: Tue, 29 Apr 2008 18:16:35 +0000
Subject: note 82859 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-138908@lists.php.net to get a copy of this message
Here's a nice function to replace multi-regexp searches: function multiBetween( $source, $search_for, $inc_start_end = false ) { # Empty Results Array $results = array(); # Literate through the array $arr_index = 0; foreach( $search_for as $index => $find ) { $result = explode( $find[1], $source ); $result = explode( $find[0], $result[0] ); $results[$arr_index] = ($inc_start_end) ? $find[0] . $result[1] . $find[1] : $result[1]; $arr_index++; } return $results; } ---- Server IP: 80.81.171.181 Probable Submitter: 88.115.233.254 ---- Manual Page -- http://www.php.net/manual/en/function.explode.php Edit -- https://master.php.net/note/edit/82859 Del: integrated -- https://master.php.net/note/delete/82859/integrated Del: useless -- https://master.php.net/note/delete/82859/useless Del: bad code -- https://master.php.net/note/delete/82859/bad+code Del: spam -- https://master.php.net/note/delete/82859/spam Del: non-english -- https://master.php.net/note/delete/82859/non-english Del: in docs -- https://master.php.net/note/delete/82859/in+docs Del: other reasons-- https://master.php.net/note/delete/82859 Reject -- https://master.php.net/note/reject/82859 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138908) next »