What is the basic function to search files for lines (or other units of text) that contain a pattern.



What is the basic function to search files for lines (or other units of text) that contain a pattern..

Answer / Abhinav Asgola

The basic function is file(filename, mode); and then use the functions like flock(), rewind(), fseek() to move through the file and fgets() or fscanf() to read the content line by line.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

hello experts good morning to everyone ! at present am now learning LAMP course sir( linux, apache,mysql and php) after finishing this course can i create my own website without investment is it possible ? please can any one tell sir and also tell me how can i upload my project after finishing the project in internet ? please tell the ways sir please send ur valuable suggestions to kiranpulsar2007@gmail.comcom

1 Answers  


Why shouldn't I use mysql_* functions in php?

1 Answers  


How can we submit a form without a submit button? What is the use of obj_star?

2 Answers   Rushmore Consultancy,


i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

1 Answers   MNC,


What is the correct line to use within the php.ini file, to specify that 128mb would be the maximum amount of memory that a script may use?

1 Answers  


How many escape sequences are recognized in double-quoted strings in php?

1 Answers  


Hello I m 1.5 exp, i want code : ms word to Html in php,retrieve the words in ms word in to dispaly browser in (same format,alignment). pls help me everybody Regards selva

0 Answers  


What is the alternative structure for control structures?

1 Answers  


What is default session time and path in php?

1 Answers  


How to define a user function?

1 Answers  


Which is faster for or foreach?

1 Answers  


How to convert a character to an ascii value?

1 Answers  


Categories