Tuesday, 27 August 2013

Finding comments in a string

Finding comments in a string

I have file which has comments at the top.
e.g.
/**
* Comments for file.
*
*/
Using PHP, I read content of file using file_get_contents into variable
now I want to get value present inside comment. For above example expected
result would be
* Comments for file
*
*
Which means I want content inside those /** and */. This file can have
multiple comments but I want the very first which is at the top of file.
Any ideas/help please ?

No comments:

Post a Comment