Forum Moderators: coopster

Message Too Old, No Replies

http string replace function

         

wavesurf

1:40 pm on Oct 22, 2004 (gmt 0)

10+ Year Member



I have tried learning regular expressions, but have quite a lot left, and I need som urgent help:

I have a link in a text that need to be changed. The link is:
[example.no...]

which needs to be translated to:
[example.no...]

have the same problem with another link:
[example.no...]

needs to be translated to:
[example.no...]

Anyone know how this can be done? Thanks a lot.

[edited by: coopster at 3:41 pm (utc) on Oct. 22, 2004]
[edit reason] generalized url per TOS [webmasterworld.com] [/edit]

ergophobe

5:03 pm on Oct 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is the situation? In the situation you describe, I would not even bother with regex, just

$link = "http://www.example.no/slideshow.html?show_id=225";

$new_line = str_replace('slideshow.html?show_id=', 'services/slideshow.php?slideshowId=', $link);

Does that help or do you have many link patterns?

Tom