Jump to content

Data Mining and Search in PHP


troylamb

Recommended Posts

I am new to PHP, but I want to write a little search tool in PHP for a website and I am having a ton of trouble with it.  I don't understand the syntax enough or know of useful functions to call.  The problem: I have a $title character which I want to scan and pick up the name in the title from a list of names I have in an array.  My logic is below.  Thanks in advance!

 

------------------------

$title = "some crazy title that has Bob in it that I am searching through";

$mylist = array("id1" => "Chis Pete",

                    "id2" => "Bob Clinton",

                    "id3" => "George Harris");

 

for ($mylist as $id => $name){

    $myid = array_search($name,$title);

}

 

echo "$myid is the id number which has the name in the title!"

------------------------

 

 

Link to comment
https://forums.phpfreaks.com/topic/112690-data-mining-and-search-in-php/
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.