didgydont Posted July 10, 2010 Share Posted July 10, 2010 hello all i have tried searching and wouldnt know where to begin. basicly i need to preg replace a string but i need to make it like so if string was this "test this string ~~getthisvalue/~~ test" basicly i want to signal a start ~~ and an end /~~ and get and replace the value between with a the value that corrisponds. maybe like ~~1/~~ and 1 might = <img src="test.jpg"> and ~~2/~~ 2 might = company name i hope i have made myself clear Quote Link to comment https://forums.phpfreaks.com/topic/207318-replace-a-string-between-two-strings/ Share on other sites More sharing options...
BillyBoB Posted July 10, 2010 Share Posted July 10, 2010 I would say the easiest choice is regular expression. http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=php+regex&btnG=Google+Search Just use google Quote Link to comment https://forums.phpfreaks.com/topic/207318-replace-a-string-between-two-strings/#findComment-1083925 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.