redarrow Posted March 27, 2006 Share Posted March 27, 2006 for some strange reason i can not copy and past on here no more, so all i need is to no how to use exist in a flat file thank you.and this ($contents==3){}dosent work on flat file please help thank you. Quote Link to comment https://forums.phpfreaks.com/topic/5892-flat-file-help-please-thank-you/ Share on other sites More sharing options...
Guest footballkid4 Posted March 27, 2006 Share Posted March 27, 2006 I have one thing to say...WHAT!?!?!?!Your question makes absolutely NO sense. Can you please state what exactly you want. Quote Link to comment https://forums.phpfreaks.com/topic/5892-flat-file-help-please-thank-you/#findComment-21086 Share on other sites More sharing options...
Prismatic Posted March 27, 2006 Share Posted March 27, 2006 lol, what? Quote Link to comment https://forums.phpfreaks.com/topic/5892-flat-file-help-please-thank-you/#findComment-21087 Share on other sites More sharing options...
litebearer Posted March 27, 2006 Share Posted March 27, 2006 Not sure why its not displaying code for me, but one more try... --- note this proceedure IS case sensitive[code]<?PHP$file_name = "some_data.dat";// set data file name$needle = "John";// set search variable$fp = f open($file_name, 'r'); // open the data file// remove the space between f and open - for some reason the board will NOT let me post the code properly$haystack = f read($fp, filesize($file_name));// read the entire contents of the file into a string// remove the space between f and read - for some reason the board will NOT let me post the code properly$ntimes = substr_count($haystack, $needle);// count times $needle is in $haystackif ($ntimes > 3) { // do something}?>[/code]Lite... Quote Link to comment https://forums.phpfreaks.com/topic/5892-flat-file-help-please-thank-you/#findComment-21175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.