Jump to content


flat file help please thank you.

  • Please log in to reply
3 replies to this topic

#1 redarrow

  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 27 March 2006 - 01:13 AM

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.
Wish i new all about php DAM i will have to learn

#2 Guest_footballkid4_*

  • Guests

Posted 27 March 2006 - 05:19 AM

I have one thing to say...WHAT!?!?!?!

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

#3 Prismatic

  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego

Posted 27 March 2006 - 05:29 AM

lol, what?

#4 litebearer

  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 27 March 2006 - 01:02 PM

Not sure why its not displaying code for me, but one more try...

--- note this proceedure IS case sensitive

$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


all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users