Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Replacing long urls with is.gd shortened urls

    I have a variable which holds only a string, and this string may contain an unlimited amount of urls inside of it. I already have a function I put together that accepts one argument, the URL to shorten, and returns the is.gd shortened url as a string. Now, what I would like to do, is for each long URL in the original string, i would like to run that URL through my shortening function, and replace the long URL with the newly shortened URL. Sorry if it is not clear what I want, go ahead and ask questions.

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    89
    Thanks
    5
    Thanked 14 Times in 14 Posts

    Thumbs up

    Hi,

    What I can suggest on a first look, this depends of using the next two php function: explode and combine.
    The goal of combine is that you keep old urls as array keys and keep they unique ( if in the input some urls are used more than once ).
    Hope it helps!
    Regards,
    Nick
    URL2SEO URL shortener and redirection services


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •