I need some help with the array that is returned by ereg();
I need to find ALL instances of a string in the format MM/DD/YY-ABC. It's a date followed by a dash and some initials.
Here's my code:
<PRE>
$note = "99/99/99-ABC88/88/88-ABC";
if(ereg("([0-9]{2}/[0-9]{2}/[0-9]{2}-[A-Z]{3})", $note, $return_array)) {
printf("<p>return_array[0]: %s</p>", $return_array[0]);
printf("<p>return_array[1]: %s</p>", $return_array[1]);
printf("<p>return_array[2]: %s</p>", $return_array[2]);
}
</PRE>
$return_array[0] and $return_array[1] both contain the string "99/99/99ABC" but $return_array[2] is empty. The way that I read the documentation it should contain "88/88/88-ABC".
Please help!