$res = preg_match("/\<\!--DESC=.*--\>/", $fstr);
This is to find a line in the format <!--DESC=Page description goes here--> in an HTML file. It works - I get the TRUEs when I should, but how do I get it to return the match itself?<?php
$res = preg_match("/<!--DESC=(.*)-->/", $fstr, $matches);
echo $matches[1];
?>
Check The Manual (<!-- m --><a class="postlink" href="http://www.php.net/preg-match">http://www.php.net/preg-match</a><!-- m -->).
This is to find a line in the format <!--DESC=Page description goes here--> in an HTML file. It works - I get the TRUEs when I should, but how do I get it to return the match itself?<?php
$res = preg_match("/<!--DESC=(.*)-->/", $fstr, $matches);
echo $matches[1];
?>
Check The Manual (<!-- m --><a class="postlink" href="http://www.php.net/preg-match">http://www.php.net/preg-match</a><!-- m -->).