Jump to content

Help finding comments


putty

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/78498-help-finding-comments/#findComment-397247
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.