Jump to content

PHP Searching W/o SQL??


marcus

Recommended Posts

Your still not being real clear. To search for text in a file you could simply use something like....

[code=php:0]
<?php
  $file = "filetosearch.txt";
  $term = "termtosearchfor";
  $fp = file_get_contents($file);
  if (strstr($fp,$term)) {
    echo "$term found in $file";
  }
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/23379-php-searching-wo-sql/#findComment-106032
Share on other sites

Archived

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

×
×
  • Create New...

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.