note 30800 added to function.ereg

From: Date: Sat, 29 Mar 2003 07:31:03 +0000
Subject: note 30800 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-45973@lists.php.net to get a copy of this message
OK maybe I am just dense but this took me a long time to realize. The first part of an expression like "bob.*john" selects the first bob and the last john in a string. For example: $string = "bob john bill ken paul scott peter paul mary kim sue"; eregi("john.*paul", $string, $return_string); echo($return_string[0]); Returns: john bill ken paul scott peter paul Instead of: john bill ken paul I hope this helps someone. -- http://www.php.net/manual/en/function.ereg.php http://master.php.net/manage/user-notes.php?action=edit+30800 http://master.php.net/manage/user-notes.php?action=delete+30800 http://master.php.net/manage/user-notes.php?action=reject+30800

« previous php.notes (#45973) next »