Forum Moderators: coopster

Message Too Old, No Replies

Process PHP string

for multiple entries

         

wesg

6:09 pm on May 3, 2008 (gmt 0)

10+ Year Member



I've written a Wordpress plugin that processes comments and modifies them to show links and now I'd like to add another feature.

I need to take a string and find everything between an @ symbol and either <br /> or :. So far my script works great if there is only one occurance of @. I want to be able to find and process multiple entries.

How might I go about doing this?

[edited by: eelixduppy at 6:16 pm (utc) on May 3, 2008]
[edit reason] no URLs, please [/edit]

IanKelley

7:55 pm on May 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Take a look at preg_match_all()

wesg

11:17 pm on May 3, 2008 (gmt 0)

10+ Year Member



Thank you Ian, I'm looking into this.

My current script contains preg_match_all("/@(.*)?:?\<br \/\>/", $content, $out);

I want to find everything between @ and either a : or <br /> . What might I do differently?