Đã hoàn thành

160741 Search and replace script.

I'm looking for a small PHP script to do a search and replace in a text file. What the script should do is this:

Open text file containing several paragraphs of text (we'll call it the story file) and replace certain words. Those words will be determined by the contents of another file (we'll call it the words file).

The file containing the list of words to be replaced will be in the following format:


soda|pop|coke|soft drink




Now lets say our text file contains the following sentence:

"The puppy had to run to get away from the automobile."

The script should open the words file and RANDOMLY replace the words puppy, run and automobile with another word from the same line. The script should ONLY match entire words. For example we might end up with any of the following:

"The dog had to rush to get away from the vehicle."

"The mutt had to dash to get away from the car."

The story file may contain several paragraphs of text. 8-10 paragraphs would be relatively common. The words file may end up containing well over 1000 lines each with 3-6 synonyms. As such, this script will need to be as fast as possible.

Kĩ năng: Bất kì công việc gì, PHP

Xem nhiều hơn: script words, word script, search match, ride match, replace, pop goes, DART, canine, need car format, php script open file, 1000 words sentence, search vehicle, dog fast, php search replace, search replace script, 1000 paragraphs, vehicle search, looking story script, words script, vehicle list, script replace, mutt , auto php script, php call pop, replace file file

Về Bên Thuê:
( 4 nhận xét ) Shelby, United States

ID dự án: #1906930

Được trao cho:


Clear with requirements. Ready to start :)

$20 USD trong 1 ngày
(697 Đánh Giá)