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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.