[PHP] RE: "trigger" words

2001-12-07 Thread Tim Ward

Yes, use a combination of file and string (or regex) functions to scan the
file for the string you want.

Tim

--
From:  Deron [SMTP:[EMAIL PROTECTED]]
Sent:  07 December 2001 02:21
To:  [EMAIL PROTECTED]
Subject:  "trigger" words

Is there an easy way with PHP, or something else, to have a document
on the
web where a certain word is mentioned within the page somewhere...in
my case
a band name and it could automatically take that name/word and
create it
as a link that's stored in either a flatfile or a database of some
sort?

Deron
www.metalages.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: "trigger" words

2001-12-07 Thread Julio Nobrega Trabalhando

  Yes! But since one must learn by trying, I will give you some general
rules.

  Okay, make it work as a function. You need the page url to grab and the
word to search. So it's a function with two arguments:

function do_it ($page_url , $word) {

  Then inside the function you fopen() the $page, and ereg($word,
$page_contents). If ereg() is succesful, you will 'return the function' to
create a link similar to:

echo "$word";
return 1;

  Or the usual $sql = "INSERT INTO table blah blah blah" using your
preferred db query function.

--

Julio Nobrega

Don't eat the yellow snow.


"Deron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there an easy way with PHP, or something else, to have a document on
the
> web where a certain word is mentioned within the page somewhere...in my
case
> a band name and it could automatically take that name/word and create
it
> as a link that's stored in either a flatfile or a database of some sort?
>
> Deron
> www.metalages.com
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]