Re: Re: [PHP3] RE: My eregi() code will not work.

From: Date: Fri, 02 Jun 2000 21:43:14 +0000
Subject: Re: Re: [PHP3] RE: My eregi() code will not work.
Groups: php.general 
Request: Send a blank email to php-general+get-927@lists.php.net to get a copy of this message
In article <39381FF5.2303D36B@arlut.utexas.edu>, Stephen Hui <shui@arlut.utexas.edu> wrote: >Ted Knudson wrote: >> >> Stephen >> >> > You'll need to have parentheses in the regex. Something like this: >> > eregi ("(<br>)", $Note, $matches); >> >> Sorry but it did not work. >> This is my code. Cut and past. >> >> <?php >> >> $Note = "<br>This is line 1.<br>This is line 2.<br>This is line >> 3.<br>"; >> >> eregi("(<br>)", $Note, $matches); >> Print $Note."<br>"; >> Print $matches[0]."0<br>"; >> Print $matches[1]."1<br>"; >> Print $matches[2]."2<br>"; >> Print $matches[3]."3<br>"; >> >> ?> Sorry, I missed the very original part of this thread, but what are you trying to do exactly? Part of the problem might be that you're not seeing it displayed since it's just displaying BR's... maybe... on my machine using the above (minus the ()'s around the <BR> in ereg) assigns $matches[0] to "<br>" and that's it. That's all it should do according to the manual.. if you want each of those lines as an element in an array, you should look at split/explode... hope this helps -philip

« previous php.general (#927) next »