PHP read file comments NOT file content - forgotten

前端 未结 5 1829
灰色年华
灰色年华 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:42

    function find_between($from,$to,$string){
       $cstring = strstr($string, $from);
       $newstring = substr(substr($cstring,0,strpos($cstring,$to)),1);
       return $newstring;
    }
    

    then just call : $comments = find_between('/\*\*','\*\*/',$myfileline);

提交回复
热议问题