From:             [EMAIL PROTECTED]
Operating system: 
PHP version:      4.0.4pl1
PHP Bug Type:     Feature/Change Request
Bug description:  Improving substr()

I am currently using the following PHP Code to get a substring from a string, that is 
delimited by two given strings, $start and $end:

function my_substr($start, $end, &$string) {
  $start = preg_quote($start);
  $end   = preg_quote($end);

  preg_match("#$start(.*?)$end#", $string, $result);
  return $result[1];
}

It would be great if PHP's substr() function could handle operations like this, by 
changing its signature accordingly, maybe to 

string substr (string string, mixed start [, mixed end])


-- 
Edit Bug report at: http://bugs.php.net/?id=10429&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to