Results 1 to 4 of 4
Thread: MAMP/LAMP backreference syntax?
Apr 6, 2012, 19:38 #1
- Join Date
- Jun 2008
- Madison, WI
- 34 Post(s)
- 2 Thread(s)
MAMP/LAMP backreference syntax?
This should be fairly simple, but it keeps failing (w/o reporting any errors) so I assume I am missing something from the syntax OR I have configred MAMP wrong.
Basically I am trying to use a back reference within my preg_match. for example, to match tag, any tag, and its contents.
$a="<em>some text goes here.</em>dshashd xxc dsfa";
$r=preg_match("/<([a-z]+)>[^<]*<\/\1>/", $a, $match);
echo ($r)? $match: "nope";
Tips for better/ faster SitePoint forum answers
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.