get specific value from file_get_content
hi i need to get specific content from th开发者_JAVA技巧e file get content but the problem is if i made a function which determine the content of a page and when i call this function in a loop (means more than 200 times) than memory limit problem occur . i have resolve this problem by increase the memory limit by ini_set . My Question is that how can i increase the performance of this function.should i use ob_flush after reading the content or there is another way .please let me know . thnks
file_get_contents()
reads the entire file into memory, which could be a problem when working on large files.
You could consider using the fopen()
family of functions, which are more memory friendly.
After getting contents of the site using file_get_contents() use mb_split() function to get the contents of the file as an array of words.
精彩评论