Welcome to the Treehouse Community
Looking to learn something new?
I just wanna know how complex links are formed and how to link them page to page like WIKIPEDIA
I just wanna know how complex links are formed and how to link them page to page like WIKIPEDIA I'm really really impressed with the information website wikipedia and i really exited php behind this can you please let me know how it's done
Shreyas Sreenivasa7,804 Points
Suppose the variable x contains your paragraph. You have a database name titles which stores the titles all the different pages on Wikipedia. You would write a loop to loop through all the words in x and write an if statement to check if there's a matching word in the titles database. If it does then check if the title includes more words, if it does then check whether it's before or after the matching word and check if those words exist in your paragraph as well. If it does then you could add a hyperlink with the link of the title (which you would be getting from the database) to those keywords and update x. Once it's done, take a preview of the parts hyperlinked and check if you wanted it to be hyperlinked and upload it to wherever you want (i suppose a database).
No not complex links how wikipedia managed to create links or urls from page to page in millions
Thanks shreyas, i'm really close to clarity ,just put machine Learning aside and work with php and mysql how that keyword checkup/hinting will be done.
Thanks shreyas, ☆☆☆☆☆
Ref: Organisation of data could be a simple answer, whenever they add information or update information they probably have a script which checks for keywords which exist in their database, and a human or probably even a script itself will check if the keyword needs to be linked or not Q: how php links the url to the particular word that found in the database when user enter(type) it , is there any special functions available in phpto do so