PHP read file comments NOT file content - forgotten

前端 未结 5 1828
灰色年华
灰色年华 2020-12-16 07:30

Sorry folks forgotten this one, I need to read the first \"batch\" of comment in a php file example would be:



        
5条回答
  •  甜味超标
    2020-12-16 07:58

    Is this what you mean?

    $file_contents = '/**
    
    sd
    asdsa
    das
    sa
    das
    sa
    a
    ad**/';
    
    preg_match('#/\*\*(.*)\*\*/#s', $file_contents, $matches);
    
    var_dump($matches);
    

提交回复
热议问题