How can i find wrong word in search box and replace with correct word

I have a search form and Many site users search for the wrong words, I want to replace these wrong words with the right ones so that users can get results faster.

I have been searching for this for several days but unfortunately I did not find any results.

I'm looking for a way if a user types wrong words like this

i love axqple
i love vaple
i love aple
i love applle
i love aplle

Replace the wrong text with Apple.

I have already checked things like the this tutorial and this topic but have not reached a conclusion

I also looked at these cases:

function str replace

find word in variable and replace with another

search string for specific word and replace it

And many more...

Given this explanation, does anyone have a solution, educational content or any tips

Thanks for any help

Topic ajax php autocomplete Wordpress javascript search

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.