Some text databse help please

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Post by Oleg Butuzov » Sun Feb 02, 2003 11:29 pm

algoritm...

1) search word converting to lower case
2) SELECT from mysql by REGEXP '%searchword%'
3) print results

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Post by Redcircle » Sun Feb 02, 2003 11:48 pm

He's not using a database so select statements won't work.


How many items are going to be in your files. Because there is no indexing it may go very slow with increased traffic and a large catalog.

anyways.. if you are firmilar with java/c++ then you should be firmilar with arrays which work pretty much the same way in PHP. http://www.php.net/array for more info anyways .

Code: Select all

$file = file('filename.txt');


that reads the contents of the filename.txt file into the array named $file.

Each index of the array contains a line from the file.

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

UPS! =)

Post by Oleg Butuzov » Mon Feb 03, 2003 12:45 am

soory =)

in your way

eregi ("$searchword", $file[$numrow]);

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests