Home Forums PHP Replace array of words with str_replace

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  Usman Haider 3 years, 2 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #674

    Usman Haider
    Keymaster

    str_replace is widely used for replacing a word or a single character in PHP. But if you want to replace multiple words at a time, then you can place them in an array and replace them using str_replace function. Here is the usage:

    Replace Multiple Words with a Single Word with str_replace:

     

     Replacing array of words with array of words in PHP (str_replace:

    Hope it helps ­čÖé

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.