Preg_Match?
Posted: Wed Sep 15, 2004 9:02 pm
Hey there!
I'm using the preg_match() function to retreieve information from a file. This is an example of the file:
Now when I use this query:
It get the content from the $title all the way down to the end of the $body tag when I only want the $title. I tried ([^\EOF;]*) but it didn't work...
Any suggestions?
I'm using the preg_match() function to retreieve information from a file. This is an example of the file:
Code: Select all
<?php
$title = <<<EOF
Title goes here
EOF;
$body = <<<EOF
Content goes here
EOF;
?>Code: Select all
<?php
if( preg_match( "/title = <<<EOF([^\|]*)EOF;/is", $content, $match ) )
$title = $match[1];
?>Any suggestions?