Jump to content

[SOLVED] replace()


jaymc

Recommended Posts

I am using replace() to replace some text, the issue I have is after it finds the first occurance of my needle it ignores the rest of the haystack

 

text = 'y did the cow jump over the mean can you tell me y or tell me y you can tell me'

text = text.replace('y', 'why')

 

For some reason, its only replacing the first y, it ignores the other 2. Any ideas why/way around it

Link to comment
https://forums.phpfreaks.com/topic/75641-solved-replace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.