Home >Backend Development >PHP Tutorial >Teach you step by step how to do a keyword matching project (search engine)----The next day, teach you how to do it----_PHP tutorial
The next day
La la la, I was in a good mood early in the morning. I came to the company early to review the last task. The last task was overfulfilled. I feel so good!
Finally, when I got to work, Xiao Ding Ding (Operations) suddenly said to me: Xiao Shuai Shuai, help me import the keywords in this document into the keyword thesaurus, okay?
I was in a very good mood, but suddenly I felt extremely cold. Fortunately, I had a good temper and said: "Wait a minute, I will help you deal with it right away."
Xiao Ding Ding (Operator) immediately had love in his eyes: Xiao Shuai Shuai, you are so kind, thank you for your hard work.
Nothing is difficult for my great programmer, start work immediately, it’s just a document.
File name:
词库.csv<br /><br />文件内容:
<span>$file</span> = <span>fopen</span>('词库.csv','r'<span>); </span><span>while</span> (<span>$data</span> = <span>fgetcsv</span>(<span>$file</span><span>)) { </span><span>$keywords</span>[] = <span>$data</span><span>; }<br />fclose($file); </span><span>foreach</span>(<span>$keywords</span> <span>as</span> <span>$keyword</span><span>) { </span><span>//</span><span>save $keyword to database</span> }
Lala lala, I am a young man selling newspapers. I am so happy that I have forgotten all my previous unhappiness. Programmers are so cute.
Journey to Happiness Another day has passed.
Xiao Ding Ding (Operator) will never have to come to me again from now on.
Currently, Baidu promotion has three matching methods: precise, phrase, and broad. Generally speaking, the golden combination matching method is: broad matching + search term report + negative keywords. In terms of traffic, it's broad>phrase>accurate. You can set it according to your actual situation!
If you want an exact match, you need to put quotes around ABC.