putty Posted November 23, 2007 Share Posted November 23, 2007 Sorry double post, Moved to : http://www.phpfreaks.com/forums/index.php/topic,168864.0.html Quote Link to comment Share on other sites More sharing options...
putty Posted November 23, 2007 Author Share Posted November 23, 2007 Ok the original message seems to have been deleted by the moderators so I will have another go at explaining my problem. I want to get all the comments out of a comment block in a particular script. The comment block looks like this <?php /** * @function: updatePage * * @Description: * Updates the page name and content * * @Parameters:4 * @Param-1:$id - int - the id number of the page to update * @Param-2:$name - varchar - the the new name to update * @Param-3:$content - varchar - the new content to update * @Param-4:$priority - int - the priority of this page, the lower the value the sooner it will be desplayed in the link bar * * @return bool - return True if page content was updated and False if there was an error */ function updatePage($id, $name, $content, $priority){ ... ?> I want to return this * @function: updatePage * * @Description: * Updates the page name and content * * @Parameters:4 * @Param-1:$id - int - the id number of the page to update * @Param-2:$name - varchar - the the new name to update * @Param-3:$content - varchar - the new content to update * @Param-4:$priority - int - the priority of this page, the lower the value the sooner it will be desplayed in the link bar * * @return bool - return True if page content was updated and False if there was an error This is what I have tried with little success. <?php preg_match_all('/\/\*\*(.*?)\*\//', $content, $matches); // Loop through each tag for ($i=0; $i < count($matches['0']); $i++) { echo $matches['1'][$i]; echo "<hr>"; } ?> Please help this problem has been bugging me down all day Thanks, Levi Putna Quote Link to comment Share on other sites More sharing options...
effigy Posted November 27, 2007 Share Posted November 27, 2007 By default . matches everything except a new line. Use the /s modifier to make it match everything. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.