Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

flat file help please thank you.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Guest footballkid4
I have one thing to say...WHAT!?!?!?!

Your question makes absolutely NO sense. Can you please state what exactly you want.

Share this post


Link to post
Share on other sites
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 $haystack

if ($ntimes > 3) {
  // do something
}
?>[/code]


Lite...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.